Zeopar Miguel
Zeopar Miguel

Reputation: 1

Specify a volume type on GKE when creating a PV

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

Answers (1)

boredabdel
boredabdel

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

Related Questions