Pods land on nodes with `NoSchedule` taints that were added after the Pods started, and they are still there. Why were they not removed?
BeginnerTroubleshootingScheduling and Pending Pods
Answer
Likely causes → Expected behaviour. NoSchedule only affects new scheduling. Only NoExecute evicts running Pods that do not tolerate it.
Diagnose →
kubectl get node ip-10-0-1-5 -o jsonpath='{.spec.taints}'
Fix → To move the Pods, use NoExecute or drain the node:
kubectl taint node ip-10-0-1-5 dedicated=batch:NoExecute
kubectl drain ip-10-0-1-5 --ignore-daemonsets --delete-emptydir-data
Prevent → Know the three effects: NoSchedule, PreferNoSchedule, NoExecute. Use drain for maintenance so PDBs are respected; NoExecute taints do not respect PDBs.
More on Scheduling and Pending Pods
Pods are Pending with `0/5 nodes are available: 5 Insufficient cpu. preemption: 0/5 nodes are available: 5 No preemption victims found for incoming pod.`Beginner`kubectl top nodes` shows nodes at 20% CPU, yet new Pods fail with `Insufficient cpu`. Explain it to a developer.Beginner`0/4 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }, 3 node(s) had untolerated taint {dedicated: gpu}`.BeginnerA StatefulSet Pod is Pending with `pod has unbound immediate PersistentVolumeClaims`.Beginner`0/3 nodes are available: 3 node(s) didn't match Pod's node affinity/selector.`BeginnerA 6-replica Deployment has 3 Pods Running and 3 Pending: `0/3 nodes are available: 3 node(s) didn't match pod anti-affinity rules`.Intermediate