Skip to content

Commit 3af9c83

Browse files
authored
Merge pull request #36534 from mac-chaffee/nfs-example
Add a Pod-based example for NFS volumes
2 parents 69850cc + 5f58dea commit 3af9c83

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

content/en/docs/concepts/storage/volumes.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,33 @@ unmounted. This means that an NFS volume can be pre-populated with data, and
762762
that data can be shared between pods. NFS can be mounted by multiple
763763
writers simultaneously.
764764

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+
765785
{{< note >}}
766786
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.
767789
{{< /note >}}
768790

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.
770792

771793
### persistentVolumeClaim {#persistentvolumeclaim}
772794

@@ -928,7 +950,7 @@ All plugin operations from the in-tree `vspherevolume` will be redirected to the
928950

929951

930952
[vSphere CSI driver](https://github.com/kubernetes-sigs/vsphere-csi-driver)
931-
must be installed on the cluster. You can find additional advice on how to migrate in-tree `vsphereVolume` in VMware's documentation page
953+
must be installed on the cluster. You can find additional advice on how to migrate in-tree `vsphereVolume` in VMware's documentation page
932954
[Migrating In-Tree vSphere Volumes to vSphere Container Storage Plug-in](https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/2.0/vmware-vsphere-csp-getting-started/GUID-968D421F-D464-4E22-8127-6CB9FF54423F.html).
933955

934956
As of Kubernetes v1.25, vSphere releases less than 7.0u2 are not supported for the

0 commit comments

Comments
 (0)