<p>my pvc.yaml</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: database-disk
  labels:
    stage: production
    name: database
    app: mysql
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
</code></pre>

<p>running <code>kubectl apply -f pvc.yaml</code> in <a href="https://github.com/ubuntu/microk8s" rel="nofollow noreferrer">microk8s</a> got following error: </p>

<blockquote>
  <p>error validating data:ValidationData(PersistentVolumeClaim):  unknown field "storage" in  io.k8s.api.core.v1.PersistenVolumeClaim if choose to ignore these errors turn validation off with --validate=false</p>
</blockquote>

<p><strong>Edit: storage indentation wrong when I copied text on my VM :( ,its working fine now</strong> </p>

invariant
<p>You forgot to specify the <code>volumeMode</code>. Add the <code>volumeMode</code> option and it should work.</p>

<p>Like this:</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: database-disk
  labels:
    stage: production
    name: database
    app: mysql
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 20Gi
</code></pre>
