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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With