<p>I am creating redis-cluster on kube with aws-gp2 persistent volume. I was using <a href="https://raw.githubusercontent.com/sanderploegsma/redis-cluster/master/redis-cluster.yml" rel="nofollow noreferrer">redis-cluster.yml</a></p>

<p>I have created Storage Class according to this <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">doc</a>, for dynamic persistence volume creation</p>

<p>This is my StorageClass definition</p>

<pre><code>    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: aws-gp2
    provisioner: kubernetes.io/aws-ebs
    parameters:
      type: gp2
      zones: us-west-2a, us-west-2b, us-west-2c
      fsType: ext4
    reclaimPolicy: Retain
    allowVolumeExpansion: true
</code></pre>

<p>When I try to create cluster volume creation stuck at <code>pending</code> state, after checking logs found this </p>

<pre><code>  $ kubectl -n staging describe pvc data-redis-cluster-0
  Name:          data-redis-cluster-0
  Namespace:     staging
  StorageClass:
  Status:        Pending
  Volume:
  Labels:        app=redis-cluster
  Annotations:   &lt;none&gt;
  Finalizers:    [kubernetes.io/pvc-protection]
  Capacity:
  Access Modes:
  Events:
    Type    Reason         Age                From                         Message
    ----    ------         ----               ----                         -------
    Normal  FailedBinding  13s (x11 over 2m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
</code></pre>

<p>and events </p>

<pre><code>    $ kubectl -n staging get events
    LAST SEEN   FIRST SEEN   COUNT     NAME                                    KIND                    SUBOBJECT   TYPE      REASON             SOURCE                        MESSAGE
    10s         10s          1         redis-cluster.15816c6dc1d6c03a          StatefulSet                         Normal    SuccessfulCreate   statefulset-controller        create Claim data-redis-cluster-0 Pod redis-cluster-0 in StatefulSet redis-cluster success
    10s         10s          1         redis-cluster.15816c6dc2226fe0          StatefulSet                         Normal    SuccessfulCreate   statefulset-controller        create Pod redis-cluster-0 in StatefulSet redis-cluster successful
    8s          10s          3         data-redis-cluster-0.15816c6dc1dfd0cb   PersistentVolumeClaim               Normal    FailedBinding      persistentvolume-controller   no persistent volumes available for this claim and no storage class is set
    3s          10s          5         redis-cluster-0.15816c6dc229258d        Pod                                 Warning   FailedScheduling   default-scheduler             pod has unbound PersistentVolumeClaims (repeated 4 times)
</code></pre>

<p>someone point out what is wrong here ?</p>

roy
<p>Since cluster doesn't have default <code>StorageClass</code>, I had to add <code>storageClassName: aws-gp2</code> to <code>volumeClaimTemplates</code>, which helped me to fix this issue</p>

<p>like this  </p>

<pre><code>  volumeClaimTemplates:
  - metadata:
      namespace: staging
      name: data
      labels:
        name: redis-cluster
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: aws-gp2
      resources:
        requests:
          storage: 100Mi
</code></pre>
