<p>I am trying to run a Redis cluster in Kubernetes in DigitalOcean.
As a poc, I simply tried running an example I found online (<a href="https://github.com/sanderploegsma/redis-cluster/blob/master/redis-cluster.yml" rel="noreferrer">https://github.com/sanderploegsma/redis-cluster/blob/master/redis-cluster.yml</a>), which is able to spin up the pods appropriately when running locally using minikube.</p>

<p>However, when running it on Digital Ocean, I always get the following error: </p>

<blockquote>
  <p>Warning  FailedScheduling  3s (x8 over 17s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 4 times) </p>
</blockquote>

<p>Given that I am not changing anything, I am not sure why this would not work. Does anyone have any suggestions?</p>

<p>EDIT: some additional info </p>

<pre><code>$ kubectl describe pvc  
Name:          data-redis-cluster-0
Namespace:     default
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  3m19s (x3420 over 14h)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
Mounted By:  &lt;none&gt;
</code></pre>

<p>EDIT: setting the default storage class partially resolved the problem!
However, the node is now not able to find available volumes to bind:</p>

<p>kubectl describe pvc:</p>

<pre><code>Name:          data-redis-cluster-0
Namespace:     default
StorageClass:  local-storage
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     WaitForFirstConsumer  12m (x9 over 13m)       persistentvolume-controller  waiting for first consumer to be created before binding
  Normal     WaitForFirstConsumer  3m19s (x26 over 9m34s)  persistentvolume-controller  waiting for first consumer to be created before binding
</code></pre>

<p>kubectl describe pod redis-cluster-0</p>

<pre><code>....
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  16m (x25 over 17m)   default-scheduler  0/5 nodes are available: 1 node(s) had taints that the pod didn't tolerate, 4 node(s) didn't find available persistent volumes to bind.
</code></pre>

<p>kubectl describe sc</p>

<pre><code>Name:                  local-storage
IsDefaultClass:        Yes
Annotations:           storageclass.kubernetes.io/is-default-class=true
Provisioner:           kubernetes.io/no-provisioner
Parameters:            &lt;none&gt;
AllowVolumeExpansion:  &lt;unset&gt;
MountOptions:          &lt;none&gt;
ReclaimPolicy:         Delete
VolumeBindingMode:     WaitForFirstConsumer
Events:                &lt;none&gt;
</code></pre>

<p>kubernetes manager pod logs:</p>

<pre><code>I1028 15:30:56.154131       1 event.go:221] Event(v1.ObjectReference{Kind:"StatefulSet", Namespace:"default", Name:"redis-cluster", UID:"7528483e-dac6-11e8-871f-2e55450d570e", APIVersion:"apps/v1", ResourceVersion:"2588806", FieldPath:""}): type: 'Normal' reason: 'SuccessfulCreate' create Claim data-redis-cluster-0 Pod redis-cluster-0 in StatefulSet redis-cluster success
I1028 15:30:56.166649       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"data-redis-cluster-0", UID:"76746506-dac6-11e8-871f-2e55450d570e", APIVersion:"v1", ResourceVersion:"2588816", FieldPath:""}): type: 'Normal' reason: 'WaitForFirstConsumer' waiting for first consumer to be created before binding
I1028 15:30:56.220464       1 event.go:221] Event(v1.ObjectReference{Kind:"StatefulSet", Namespace:"default", Name:"redis-cluster", UID:"7528483e-dac6-11e8-871f-2e55450d570e", APIVersion:"apps/v1", ResourceVersion:"2588806", FieldPath:""}): type: 'Normal' reason: 'SuccessfulCreate' create Pod redis-cluster-0 in StatefulSet redis-cluster successful
I1028 15:30:57.004631       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"data-redis-cluster-0", UID:"76746506-dac6-11e8-871f-2e55450d570e", APIVersion:"v1", ResourceVersion:"2588825", FieldPath:""}): type: 'Normal' reason: 'WaitForFirstConsumer' waiting for first consumer to be created before binding
</code></pre>

user3162649
<p>This:</p>

<blockquote>
  <p>no storage class is set</p>
</blockquote>

<p>And an empty output for <code>kubectl describe sc</code> means that there's no storage class.</p>

<p>I recommend installing the <a href="https://github.com/digitalocean/csi-digitalocean" rel="noreferrer">CSI-driver</a> for Digital Ocean. That will create a <code>do-block-storage</code> class using the Kubernetes CSI interface. </p>

<p>Another option is to use local storage. Using a <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#local" rel="noreferrer">local</a> storage class:</p>

<pre><code>$ cat &lt;&lt;EOF
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
EOF | kubectl apply -f -
</code></pre>

<p>Then for either case you may need to set it as a default storage class if you don't specify <code>storageClassName</code> in your PVC:</p>

<pre><code>$ kubectl patch storageclass local-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
</code></pre>

<p>or</p>

<pre><code>$ kubectl patch storageclass do-block-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
</code></pre>
