Created
November 9, 2020 06:25
-
-
Save DevopsVlogger/758d8aea437983064f9446fc06f34a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: pod-using-nfs | |
spec: | |
# Add the server as an NFS volume for the pod | |
volumes: | |
- name: nfs-volume | |
nfs: | |
# URL for the NFS server | |
server: 192.168.17.35 # This should be nfs server pod IP | |
path: / | |
# In this container, we'll mount the NFS volume | |
# and write the date to a file inside it. | |
containers: | |
- name: app | |
image: alpine | |
# Mount the NFS volume in the container | |
volumeMounts: | |
- name: nfs-volume | |
mountPath: /var/nfs | |
# Write to a file inside our NFS | |
command: ["/bin/sh"] | |
args: ["-c", "while true; do date >> /var/nfs/dates.txt; sleep 5; done"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment