To setup the NFS Storage Class and Persistent Volume Provisioner for any nameapce.
Based on Kubernetes NFS Subdir External Provisioner.
NOTE: Apply NFS Provisioner Storage Class only once per cluster.
To setup NFS Provisioner Storage Class:
- Apply the manifest:
kubectl apply -f nfs-provisioner-class.yaml
- Verify the Storage Class:
kubectl get storageclass
To delete NFS Provisioner Storage Class:
- Apply the manifest:
kubectl delete -f nfs-provisioner-class.yaml
- Verify the Storage Class:
kubectl get storageclass
NOTE: Apply NFS Provisioner RBAC and Deployment for every namespace that required this NFS storage for data persistence.
To setup NFS Provisioner RBAC and Deployment for a namespace:
- Update the <NAMESPACE> in base/kustomization.yaml
- Update the <NFS_SERVER_IP> & <NFS_SHARE> in overlays/prod/nfs-provisioner-deployment.yaml
- Verify the output manifests to be applied:
kubectl kustomize <path-to-main-folder>/overlays/prod
- Apply the manifests:
kubectl kustomize <path-to-main-folder>/overlays/prod | kubectl apply -f -
- Test Persistent Volume Claim:
kubectl apply -f test-claim.yaml
- Verify the Persistent Volume Claim, ensure the status of the pvc is Bound:
kubectl get pvc -n <namespace>
- Delete the Persistent Volume Claim:
kubectl delete -f test-claim.yaml
To delete NFS Provisioner RBAC and Deployment for a namespace:
- Update the <NAMESPACE> in base/kustomization.yaml
- Update the <NFS_SERVER_IP> & <NFS_SHARE> in overlays/prod/nfs-provisioner-deployment.yaml
- Verify the output manifests to be deleted:
kubectl kustomize <path-to-main-folder>/overlays/prod
- Apply the manifests:
kubectl kustomize <path-to-main-folder>/overlays/prod | kubectl delete -f -