Attempting and failing to use NFS storage for Kubernetes volumes.
persistentvolumeclaim is unable to bind to already created persistentvolume, see below
Creating persistentvolume
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
nfs:
server: 192.0.2.100
path: "/nfsshare"
Creating persistentvolumeclaim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
Event logs for the persistentvolumeclaim shows
kubectl get events:
"provisionable volume plugin matched"
Any ideas what might be stop k8s to bind the two?
Add following line in both PV and PVC yaml
spec: storageClassName: manual
It will create PV and use PV claim from that PV
delete any default storage class (nfs) and try creating PV & PVC again
kubectl get sc
kubectl delete sc