Skip to content

Instantly share code, notes, and snippets.

@laverya
Created October 10, 2022 23:37
Show Gist options
  • Save laverya/f2e4c0a9ff727ecbde219920df17d0f1 to your computer and use it in GitHub Desktop.
Save laverya/f2e4c0a9ff727ecbde219920df17d0f1 to your computer and use it in GitHub Desktop.
A statefulset that reads and writes a lot of storage.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: muchstorage
spec:
serviceName: "muchstorage"
replicas: 7
selector:
matchLabels:
app: muchstorage
template:
metadata:
labels:
app: muchstorage
spec:
containers:
- name: nginx
image: k8s.gcr.io/nginx-slim:0.8
#command: ["sh", "-c", "echo 'starting script'; dd if=/dev/urandom of=/mnt/8GB.bin bs=64M count=128 iflag=fullblock; ls -alh /mnt; sha256sum /mnt/8GB.bin ; sleep 500d"]
command: ["sh", "-c", "echo 'starting script'; while :; do echo 'loop start'; dd if=/dev/urandom of=/mnt/8GB.bin bs=64M count=128 iflag=fullblock; ls -alh /mnt; sha256sum /mnt/8GB.bin; done"]
ports:
- containerPort: 80
name: web
volumeMounts:
- name: www
mountPath: /mnt
volumeClaimTemplates:
- metadata:
name: www
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment