Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minikube dashboard and any other pods won't schedule

After following the hello-minikube guide and installing minikube 0.26.1 the dashboard pod is not starting and also the hello-minikube pod is not getting started.

A kubectl describe pod xxx shows that the pod could not get scheduled.

Events:
 Type     Reason            Age                  From              Message
 ----     ------            ----                 ----               -------
 Warning  FailedScheduling  3m (x3368 over 16h)  default-scheduler  0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
like image 846
Ralf Avatar asked Apr 24 '18 08:04

Ralf


People also ask

Why are pods not scheduled on master nodes?

Security pods are not scheduled since the master nodes do not meet the required memory or CPU requirements. The output has the information about memory and CPU requirements. If the resource requirement is not met, increase the master node's memory or CPU.

Why are pods stuck pending?

If a Pod is stuck in Pending it means that it can not be scheduled onto a node. Generally this is because there are insufficient resources of one type or another that prevent scheduling. Look at the output of the kubectl describe ... command above.

Why my deployment is not ready in Kubernetes?

If a Pod is Running but not Ready it means that the Readiness probe is failing. When the Readiness probe is failing, the Pod isn't attached to the Service, and no traffic is forwarded to that instance.


1 Answers

This has to do with taints and tolerations in k8s versions starting from 1.6. By default the master node has a NoSchedule taint.

# kubectl describe node minikube
Name:               minikube
Roles:              master
[...]
Taints:             node-role.kubernetes.io/master:NoSchedule

You can add tolerations to the pods as described in this answer - but in my case I do not want to edit any pod specs as I want to test my deployments locally 1:1 as in a live k8s environment.

The other option is to delete the taint on the master node. See the documentation here and there.

kubectl taint nodes --all node-role.kubernetes.io/master-

In the specific case of a local minikube setup with only one node and testing deployments locally without adding tolerations this works as well:

kubectl taint nodes minikube node-role.kubernetes.io/master:NoSchedule-

This should be part of the minikube getting started guide imho.

like image 58
Ralf Avatar answered Oct 17 '22 04:10

Ralf