Interview Prep/Kubernetes/Scheduling and Pending Pods

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.

All Kubernetes questions Roadmap: Kubernetes core

More on Scheduling and Pending Pods