So I am trying to create a persistent volume on GKE with the definition below:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv01-3gi
labels:
env: prod
spec:
capacity:
storage: 5Gi
accessModes:
- 'ReadWriteOnce'
storageClassName: standard
However when I try to apply this, I get the error message shown below:
? kubectl apply -f pv-1.yaml
The PersistentVolume "pv01-3gi" is invalid: spec: Required value: must specify a volume type
My understanding is that the volume type is indicated by the storage class which is set to standard (which is a default storage class offered by GKE
? kubectl get storageclass
NAME PROVISIONER AGE
standard (default) kubernetes.io/gce-pd 16d
What am I doing wrong?
question from:https://stackoverflow.com/questions/65839181/persistent-volume-issue-on-gke