<p>One of my pods has 'StatefulSet' kind with volumeClaimTemplates section referring to a StorageClass(SC) I created, see below.</p>

<p>SC:</p>

<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
</code></pre>

<p>StatefulSet YAML with reference to above created SC:</p>

<pre><code>volumeClaimTemplates:
    - metadata:
        name: mydata
      spec:
        storageClassName: local-storage
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 2Gi
</code></pre>

<p>As far as I am aware, a StatefulSet will create node specific PVCs without a need for explicit PV and PVC set up, I see that PV being created but the pod status is 'pending' with below warning.</p>

<blockquote>
  <p>Warning  FailedScheduling  default-scheduler  0/4 nodes are available: 4 node(s) didn't find available persistent volumes to bind.</p>
</blockquote>

<p>Note that I don't have a default StorageClass set up in the cluster, I believe that's not required for this scenario, is that correct?
Do we need to enable or configure anything for 'local' provisioner to work in the cluster?</p>

<p>Thanks</p>

cnu
<p>Found out hard way that missing piece for this to work was PV set up.</p>

<pre><code>---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-loc-sc
spec:
  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-storage 
  capacity:
    storage: 2Gi
  accessModes:
    - ReadWriteOnce
  local:
    path: "/var/lib/test"
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - my-test-node-host-name
</code></pre>

<p>The FailedScheduling warning went away with PV, SC, and reference to the SC in StatefulSet pod YAML.</p>
