<p>As the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#components" rel="noreferrer">documentation</a> states:</p>
<blockquote>
<p>For each VolumeClaimTemplate entry defined in a StatefulSet, each Pod
receives one PersistentVolumeClaim. In the nginx example above, each
Pod receives a single PersistentVolume with a StorageClass of
my-storage-class and 1 Gib of provisioned storage. If no StorageClass
is specified, then the default StorageClass will be used. When a Pod
is (re)scheduled onto a node, its volumeMounts mount the
PersistentVolumes associated with its PersistentVolume Claims. Note
that, the PersistentVolumes associated with the Pods' PersistentVolume
Claims are not deleted when the Pods, or StatefulSet are deleted. This
must be done manually.</p>
</blockquote>
<p>The part I'm interested in is this: <code>If no StorageClassis specified, then the default StorageClass will be used</code></p>
<p>I create a StatefulSet like this:</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  namespace: ches
  name: ches
spec:
  serviceName: ches
  replicas: 1
  selector:
    matchLabels:
      app: ches
  template:
    metadata:
      labels:
        app: ches
    spec:
      serviceAccountName: ches-serviceaccount
      nodeSelector:
        ches-worker: &quot;true&quot;
      volumes:
      - name: data
        hostPath:
          path: /data/test
      containers:
      - name: ches
        image: [here I have the repo]
        imagePullPolicy: Always
        securityContext:
            privileged: true
        args:
        - server
        - --console-address
        - :9011
        - /data
        env:
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: ches-keys
              key: access-key
        - name: MINIO_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: ches-keys
              key: secret-key
        ports:
        - containerPort: 9000
          hostPort: 9011
        resources:
          limits:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: data
          mountPath: /data
      imagePullSecrets:
        - name: edge-storage-token
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
</code></pre>
<p>Of course I have already created the secrets, imagePullSecrets etc and I have labeled the node as ches-worker.</p>
<p>When I apply the yaml file, the pod is in Pending status and <code>kubectl describe pod ches-0 -n ches</code> gives the following error:</p>
<blockquote>
<p>Warning  FailedScheduling  6s    default-scheduler  0/1 nodes are
available: 1 pod has unbound immediate PersistentVolumeClaims.
preemption: 0/1 nodes are available: 1 Preemption is not helpful for
scheduling</p>
</blockquote>
<p>Am I missing something here?</p>

e7lT2P
<p>You need to create a PV in order to get a PVC bound. If you want the PVs automatically created from PVC claims you need a Provisioner installed in your Cluster.</p>
<p>First create a PV with at least the amout of space need by your PVC.
Then you can apply your deployment yaml which contains the PVC claim.</p>
