<p>Hi All I use GKE and created a cluster in Google cloud.
Here is my Persistent volume</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongo-pv
spec:
  capacity:
    storage: 256Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /tmp/db
</code></pre>
<p>Here is the command that created persistent volume</p>
<pre><code>kubectl create -f mongo-pv.yaml
</code></pre>
<p>persistentvolumeclaim</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mongo-pvc
spec:
  accessModes:
    - ReadWriteOnce
  volumeName: mongo-pv
  resources:
    requests:
      storage: 256Mi
</code></pre>
<p>applied using</p>
<pre><code>kubectl create -f mongo-pvc.yaml
</code></pre>
<p>however the command to get pvc always shows pending. It should be showing up. Not sure what is wrong in the yaml files</p>
<pre><code>kubectl get pvc
NAME        STATUS    VOLUME     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
mongo-pvc   Pending   mongo-pv   0                         standard-rwo
</code></pre>
<p><strong>Update</strong></p>
<pre><code> kubectl describe pvc mongo-pvc
Name:          mongo-pvc
Namespace:     default
StorageClass:  standard-rwo
Status:        Pending
Volume:        mongo-pv
Labels:        &lt;none&gt;
Annotations:   &lt;none&gt;
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      0
Access Modes:  
VolumeMode:    Filesystem
Used By:       &lt;none&gt;
Events:
  Type     Reason          Age                  From                         Message
  ----     ------          ----                 ----                         -------
  Warning  VolumeMismatch  23s (x262 over 65m)  persistentvolume-controller  Cannot bind to requested volume &quot;mongo-pv&quot;: storageClassName does not match
</code></pre>

bionics parv
<p>Your PV's storage class name is empty but your PVC's storage class name is filled automatically as <code>standard-rwo</code> because of the DefaultStorageClass admission plugin.</p>
<p>These paragraphs are from <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1" rel="nofollow noreferrer">Kubernetes documentation</a>:</p>
<blockquote>
<p>A claim can request a particular class by specifying the name of a StorageClass using the attribute storageClassName. Only PVs of the requested class, ones with the same storageClassName as the PVC, can be bound to the PVC.</p>
</blockquote>
<blockquote>
<p>PVCs don't necessarily have to request a class. A PVC with its storageClassName set equal to &quot;&quot; is always interpreted to be requesting a PV with no class, so it can only be bound to PVs with no class (no annotation or one set equal to &quot;&quot;). A PVC with no storageClassName is not quite the same and is treated differently by the cluster, depending on whether the DefaultStorageClass admission plugin is turned on.</p>
</blockquote>
<p>I guess you should either <strong>turn off DefaultStorageClass admission plugin and apply your manifests again</strong> or <strong>give your PV the same storage class name</strong> like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongo-pv
spec:
  storageClassName: standard-rwo
  capacity:
    storage: 256Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /tmp/db
</code></pre>
