Reputation: 1
When creating a PV on GKE and applying the pv.yaml I get an error message:
The PersistentVolume "pv" is invalid: spec: Required value: must specify a volume type
The pv.yaml is show as below
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv
spec:
capacity:
storage: 1Gi
accessModes:
- 'ReadWriteOnce'
storageClassName: standard
How can I resolve this issue?
Upvotes: 0
Views: 718
Reputation: 2130
It's recommended to use PeristentVolumeClaims which provisions PersistentVolume for your automatically, this is called dynamic provisioning.
You should manually provision PersistentVolume only if you want to link to an preexisting Persistent disk. Here is the doc for more info
Upvotes: 1