github.com/qsunny/k8s@v0.0.0-20220101153623-e6dca256d5bf/examples-master/staging/volumes/nfs/nfs-busybox-rc.yaml (about) 1 # This mounts the nfs volume claim into /mnt and continuously 2 # overwrites /mnt/index.html with the time and hostname of the pod. 3 4 apiVersion: v1 5 kind: ReplicationController 6 metadata: 7 name: nfs-busybox 8 spec: 9 replicas: 2 10 selector: 11 name: nfs-busybox 12 template: 13 metadata: 14 labels: 15 name: nfs-busybox 16 spec: 17 containers: 18 - image: busybox 19 command: 20 - sh 21 - -c 22 - 'while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done' 23 imagePullPolicy: IfNotPresent 24 name: busybox 25 volumeMounts: 26 # name must match the volume name below 27 - name: nfs 28 mountPath: "/mnt" 29 volumes: 30 - name: nfs 31 persistentVolumeClaim: 32 claimName: nfs