From aec20218334461d86487702d365de82699467658 Mon Sep 17 00:00:00 2001 From: Joshua Moody Date: Tue, 30 Jun 2020 15:22:38 -0700 Subject: [PATCH] Add rwx-test deployment (append only log) The test deployment creates 4 replicas that continously, write the current date time once a second into the file `/mnt/nfs-test/test.log` This is a good test for an rwx volume. Since it replicates an append only log that is used by multiple pods. Signed-off-by: Joshua Moody --- examples/rwx/03-rwx-test.yaml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 examples/rwx/03-rwx-test.yaml diff --git a/examples/rwx/03-rwx-test.yaml b/examples/rwx/03-rwx-test.yaml new file mode 100644 index 0000000..7403403 --- /dev/null +++ b/examples/rwx/03-rwx-test.yaml @@ -0,0 +1,57 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-test +spec: + accessModes: + - ReadWriteMany + storageClassName: longhorn-nfs + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nfs-test + labels: + app: nfs-test +spec: + replicas: 4 + selector: + matchLabels: + app: nfs-test + strategy: + type: Recreate + template: + metadata: + labels: + app: nfs-test + spec: + containers: + - image: ubuntu:xenial + imagePullPolicy: Always + command: ["/bin/sh", "-c"] + args: + - sleep 30; touch /mnt/nfs-test/test.log; while true; do date >> /mnt/nfs-test/test.log; sleep 1; done; + name: nfs-test + stdin: true + tty: true + livenessProbe: + exec: + command: + - timeout + - "10" + - ls + - /mnt/nfs-test + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 10 + volumeMounts: + - mountPath: /mnt/nfs-test + name: nfs-test + restartPolicy: Always + volumes: + - name: nfs-test + persistentVolumeClaim: + claimName: nfs-test