I'm trying to setup a volume to use with Mongo on k8s.
I use kubectl create -f pv.yaml
to create the volume.
pv.yaml:
kind: PersistentVolume
apiVersion: v1
metadata:
name: pvvolume
labels:
type: local
spec:
storageClassName: standard
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/nfs"
claimRef:
kind: PersistentVolumeClaim
namespace: default
name: pvvolume
I then deploy this StatefulSet that has pods making PVCs to this volume.
My volume seems to have been created without problem, I'm expecting it to just use the storage of the host node.
When I try to deploy I get the following error:
Unable to mount volumes for pod "mongo-0_default(2735bc71-5201-11e8-804f-02dffec55fd2)": timeout expired waiting for volumes to attach/mount for pod "default"/"mongo-0". list of unattached/unmounted volumes=[mongo-persistent-storage]
Have a missed a step in setting up my persistent volume?
volumeName
is set, but the PVC is still pending. – Captive