DigitalOcean pod has unbound immediate PersistentVolumeClaims

前端 未结 2 1472
刺人心
刺人心 2021-02-20 04:01

I am trying to run a Redis cluster in Kubernetes in DigitalOcean. As a poc, I simply tried running an example I found online (https://github.com/sanderploegsma/redis-cluster/blo

相关标签:
2条回答
  • 2021-02-20 04:53

    This:

    no storage class is set

    And an empty output for kubectl describe sc means that there's no storage class.

    I recommend installing the CSI-driver for Digital Ocean. That will create a do-block-storage class using the Kubernetes CSI interface.

    Another option is to use local storage. Using a local storage class:

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

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

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

    or

    $ kubectl patch storageclass do-block-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
    
    0 讨论(0)
  • 2021-02-20 04:59

    It is a statefulSet using PersistentVolumeClaims

    You need to configure a default storageClass in your cluster so that the PersistentVolumeClaim can take the storage from there.

    In minikube one is already available so it succeeds without error:

    C02W84XMHTD5:ucp iahmad$ kubectl get sc --all-namespaces 
    NAME                 PROVISIONER                AGE
    standard (default)   k8s.io/minikube-hostpath   7d
    
    0 讨论(0)
提交回复
热议问题