Table of Contents |
---|
...
External Server Example
The usual patterns should work here:
...
volumes:
- name: nfs
nfs:
server: <NFS_SERVER_IP>
path: /
NFS Client Provisioner
For an easy way to get up and running serving shared volumes on Kubernetes from an existing NFS server, check out the nfs-client provisioner.
Provisioners like this one allow you to use Kubernetes to manage the lifecycle of your Kubernetes volumes and their data using PVCs, or PersistentVolumeClaims
.
The basic workflow is as follows:
- User creates a PVC resource in Kubernetes with an attached
StorageClass
(if none is specified, the default will be used based on your cloud type - this blog post lists the default storage classes for each cloud provider) - Kubernetes uses the StorageClass to determine how/whether a PV (
PersistentVolume
) should be created based on the claim parameters (e.g. for NFS, this effectively does amkdir
) - If no existing static PV matches the parameters in the PVC, a new one should be dynamically created
- The PV can then be mounted into client pods by specifying the PVC name as a volume
For more details, see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic
Basic In-Cluster Server Example
...