You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/concepts/storage/volumes.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -762,11 +762,33 @@ unmounted. This means that an NFS volume can be pre-populated with data, and
762
762
that data can be shared between pods. NFS can be mounted by multiple
763
763
writers simultaneously.
764
764
765
+
```yaml
766
+
apiVersion: v1
767
+
kind: Pod
768
+
metadata:
769
+
name: test-pd
770
+
spec:
771
+
containers:
772
+
- image: registry.k8s.io/test-webserver
773
+
name: test-container
774
+
volumeMounts:
775
+
- mountPath: /my-nfs-data
776
+
name: test-volume
777
+
volumes:
778
+
- name: test-volume
779
+
nfs:
780
+
server: my-nfs-server.example.com
781
+
path: /my-nfs-volume
782
+
readonly: true
783
+
```
784
+
765
785
{{< note >}}
766
786
You must have your own NFS server running with the share exported before you can use it.
787
+
788
+
Also note that you can't specify NFS mount options in a Pod spec. You can either set mount options server-side or use [/etc/nfsmount.conf](https://man7.org/linux/man-pages/man5/nfsmount.conf.5.html). You can also mount NFS volumes via PersistentVolumes which do allow you to set mount options.
767
789
{{< /note >}}
768
790
769
-
See the [NFS example](https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs) for more details.
791
+
See the [NFS example](https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs) for an example of mounting NFS volumes with PersistentVolumes.
0 commit comments