DigitalOcean pod has unbound immediate PersistentVolumeClaims
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 <<EOFkind: StorageClassapiVersion: storage.k8s.io/v1metadata: name: local-storageprovisioner: kubernetes.io/no-provisionervolumeBindingMode: WaitForFirstConsumerEOF | 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"}}}'
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 AGEstandard (default) k8s.io/minikube-hostpath 7d