<p>I got <code>PersistentVolume in version &quot;v1&quot; cannot be handled as a PersistentVolume</code> error on k8s when I create a local persistent volume.</p>
<p>The output is:</p>
<pre><code>Error from server (BadRequest): error when creating &quot;setLocalPv.yaml&quot;: 
PersistentVolume in version &quot;v1&quot; cannot be handled as a PersistentVolume: 
v1.PersistentVolume.Spec: v1.PersistentVolumeSpec.PersistentVolumeSource: 
Local: Capacity: unmarshalerDecoder: quantities must match the regular 
expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of 
...|ilesystem&quot;},&quot;local&quot;:|..., bigger context ...|acity&quot;:
{&quot;storage&quot;:&quot;10Gi&quot;,&quot;volumeMode&quot;:&quot;Filesystem&quot;},&quot;local&quot;:{&quot;path&quot;:&quot;/k8sNodeData&quot;},&quot;nodeAffinity&quot;:
{|...
</code></pre>
<p>My yaml files are here.</p>
<p>setStorageClassSSD.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>---

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-ssd-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
---
</code></pre>
<p>setLocalPv.yaml:<br></p>
<pre class="lang-yaml prettyprint-override"><code>---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: dataStorage
spec:
  capacity:
    storage: 10Gi
    volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-ssd-storage
  local:
    path: /k8sNodeData
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: disktype
          operator: In
          values:
          - ssd
---
</code></pre>
<p>I'd like to know where to fix it.</p>

<p>Looks like issue with format. Can you move <code>volumeMode: Filesystem</code> to <code>capacity</code> level.</p>
<pre><code>  spec:
    capacity:
      storage: 10Gi
    volumeMode: Filesystem
    accessModes:
    - ReadWriteOnce
</code></pre>
