<p>So I am trying to create a persistent volume on GKE with the definition below:</p>
<pre><code>
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv01-3gi
  labels:
    env: prod
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - 'ReadWriteOnce'
  storageClassName: standard

</code></pre>
<p>However when I try to apply this, I get the error message shown below:</p>
<pre><code>➜ kubectl apply -f pv-1.yaml
The PersistentVolume &quot;pv01-3gi&quot; is invalid: spec: Required value: must specify a volume type

</code></pre>
<p>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</p>
<pre><code>
➜ kubectl get storageclass
NAME                 PROVISIONER            AGE
standard (default)   kubernetes.io/gce-pd   16d

</code></pre>
<p>What am I doing wrong?</p>

<p>Please note that Storage Classes on directly provisioned Persistent Volumes <strong>only serve the purpose to make it possible to reference those volumes via Persistent Volume Claims</strong>!</p>
<p>The intention here is that a system administrator sets up a bunch of Persistent Volumes and deals with the details of referencing hard drive devices outside of the cluster. Then an application developer can reference those volumes via Persistent Volume Claims, by stating figuratively speaking: &quot;Please find me a volume of StorageClass SSD with at least 5GB storage&quot;.</p>
<p>In other words, if you create a PV directly, please make sure you provide the exact configuration including the reference to the physical storage device.</p>
