I’m running Docker Desktop with Kubernetes.
I can ssh to the node and I have other pods running on the node.
However, when I apply a StatefulSet to the cluster I get:
0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.
The Stateful Set is here:
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#components
kubectl get no
NAME STATUS ROLES AGE VERSION
docker-desktop Ready control-plane 6d2h v1.24.1
3
Answers
If you are applying the manifest defined here as it is, the problem is in the below snippet, particularly with the
storageClassName.
Likely, your cluster does not have a storage class calledmy-storage-class.
To get the definitive error statement, you can run the following command:
you will notice something like:
Solution:
You can run the following command to get your cluster’s available
storage class
and replace it in yaml file.Alternatively, you can delete the
storageClassName
and let the default storage class do the magic. However, for this to work, you must have a default sc present in your cluster.If you have no storage class present, you need to create one. Check this out.
if your using k8s locally with docker desktop ensure that the storageClassName is set to "hostpath" below is one of my volumeClaimTemplates for a local redis cluster. The comment has saved me a few times when getting the "0/1 nodes are available" which is a confusing error
I was also facing the same issue with Mac Apple M1 Pro. I also found related issue on github.
https://github.com/docker/for-mac/issues/2560
I was getting exact same error described in above github issue by following mentioned steps.
So as per suggestions in that thread, I have tried
Reset Kubernetes cluster
,Clean/Purge Data
andReset to Factory defaults
from Troubleshoot section. But none of them worked for me.Finally, I have entirely uninstalled Docker desktop and reinstalled it again by downloading latest installer from official site, which has fixed the issue. Now, I am getting
Bound
status instead ofPending
when I can pvc.