<p>I'ts been 60min now and my persistent volume claim is still pending.</p>
<p>My storage class:</p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
</code></pre>
<p>Minikube did not supply this one, I had to add it with the yaml above. In the dashboard I can click on it and it references the persistent volume which is green/ok.</p>
<p>My persistent volume (green, ok):</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: small-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: /data
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - minikube
</code></pre>
<p>The reason I need persistent storage is that nodered store its data in /data so that whats I'm trying to do here; provide it with persistent volume to store data. And since this is locally using minikube I can take advantage of /data folder on the minikube instance that per documentation is persistent.</p>
<p>My persistent volume claim for my nodered app.</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nodered-claim
spec:
  storageClassName: local-storage
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
</code></pre>
<p>If I add the deployment or not, the persistent storage claim is still yellow/pending in the dashboard. Any reason for that? What am I missing here?</p>
<p><strong>Update:</strong></p>
<p>kubectl describe pvc/nodered-claim:</p>
<pre><code>Type    Reason                Age                    From                         Message
  ----    ------                ----                   ----                         -------
  Normal  WaitForFirstConsumer  2m52s (x162 over 42m)  persistentvolume-controller  waiting for first consumer to be created before binding
</code></pre>

bobby2947
<p>Update your StorageClass to immediate:</p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: Immediate  # &lt;-- bind as soon as PVC is created
</code></pre>
<p><code>WaitForFirstConsumer</code> will only bind when a Pod uses your PVC.</p>
<p><code>...If I add the deployment or not, the persistent storage claim is still yellow/pending in the dashboard.</code></p>
<p>Your deployment will also enter pending state if the PVC it needs failed to bind.</p>
