As you have mentioned, the following errors related to FailedScheduling occurred once the kubectl get events command used
Error 1: FailedScheduling
node(s) had taint {node-role.kubernetes.io/master: }, that the pod
didn't tolerate
Taints and toleration work together to ensure that pods are not scheduled on inappropriate nodes.
To check if node has taint or not
kubectl describe node <nodename> | grep Taints
A similar output is provided if any taint present on node
node-role.kubernetes.io/master:NoSchedule
If you want to keep the taint on the node as it is and still you want to schedule a particular pod on that node then include this in your pod/deployment.yaml file.
tolerations:
- key: "key"
operator: "Exists"
effect: "NoSchedule"
If you want to remove taint from the node, update the below command.
kubectl taint node master node-role.kubernetes.io/master:NoSchedule-
Make sure to add -
in front of NoSchedule
For more information, you can follow the official document.
Error 2:
Insufficient CPU
If a pod specifies resource requests—the minimum amount of CPU and/or memory it needs in order to run—the Kubernetes scheduler will attempt to find a node that can allocate resources to satisfy those requests. If it is unsuccessful, the pod will remain Pending until more resources become available.
You can find more information in the blog written by Emily Chang which provides solutions for different scenarios related to scheduling failures.