They're both really really pedantic about columnar positioning ....
Whilst trying to create a Persistent Volume in my IBM Cloud Private (ICP) 3.1.1 cluster, using the following YAML: -
apiVersion: v1
kind: PersistentVolume
metadata:
name: cam-mongo-pv
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteMany
nfs:
server: dmhicp-boot.fyre.ibm.com
path: "/export/CAM_db"
apiVersion: v1
kind: PersistentVolume
metadata:
name: cam-mongo-pv
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteMany
nfs:
server: dmhicp-boot.fyre.ibm.com
path: "/export/CAM_db"
Whilst trying to create a Persistent Volume in my IBM Cloud Private (ICP) 3.1.1 cluster, using the following YAML: -
apiVersion: v1
kind: PersistentVolume
metadata:
name: cam-mongo-pv
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteMany
nfs:
server: dmhicp-boot.fyre.ibm.com
path: "/export/CAM_db"
the command: -
kubectl apply -f createCAM_PV1.yaml
failed spectacularly with: -
error: error validating "createCAM_PV1.yaml": error validating data: [ValidationError(PersistentVolume): unknown field "path" in io.k8s.api.core.v1.PersistentVolume, ValidationError(PersistentVolume.spec.nfs): missing required field "path" in io.k8s.api.core.v1.NFSVolumeSource]; if you choose to ignore these errors, turn validation off with --validate=false
The solution was, of course, obvious .....
Yes, the path wasn't in line with the server element of the nfs section.
Bring back XML, all is forgiven !
Once I fixed my YAML: -
apiVersion: v1
kind: PersistentVolume
metadata:
name: cam-mongo-pv
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteMany
nfs:
server: dmhicp-boot.fyre.ibm.com
path: "/export/CAM_db"
all was good :-)
kubectl apply -f createCAM_PV1.yaml
persistentvolume/cam-mongo-pv created