Skip to content

Instantly share code, notes, and snippets.

@bliotti
Created May 10, 2021 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bliotti/f97a6e05ccf95a71b8b14e25b5c6a463 to your computer and use it in GitHub Desktop.
Save bliotti/f97a6e05ccf95a71b8b14e25b5c6a463 to your computer and use it in GitHub Desktop.
# This mounts the nfs volume claim into /mnt and continuously
# overwrites /mnt/index.html with the time and hostname of the pod.
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 1
selector:
matchLabels:
name: test
template:
metadata:
labels:
name: test
spec:
containers:
- image: cloudgenius/toolimage:ubuntu
command:
- sh
- -c
- "while true; do date > /mnt/test.html; hostname >> /mnt/test.html; sleep 5; done"
imagePullPolicy: Always
name: test
volumeMounts:
# name must match the volume name below
- name: my-pvc-nfs
mountPath: "/mnt"
volumes:
- name: my-pvc-nfs
persistentVolumeClaim:
claimName: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment