Interview Prep/Kubernetes/Scheduling and Pending Pods

Some Pods are Pending in only one namespace while identical Pods schedule fine elsewhere.

AdvancedTroubleshootingScheduling and Pending Pods
Answer

Likely causes → Something namespace-scoped changes the Pod spec: a LimitRange injecting large default requests, a mutating webhook adding a nodeSelector or toleration, a Kyverno mutate rule, or a PodNodeSelector-style namespace annotation (scheduler.alpha.kubernetes.io/node-selector).

Diagnose →

kubectl get limitrange -n team-a -o yaml
kubectl get ns team-a -o jsonpath='{.metadata.annotations}'
# Compare the stored Pod spec with the template
kubectl get pod web-x -n team-a -o yaml | yq '.spec.nodeSelector, .spec.containers[].resources, .spec.tolerations'
kubectl get mutatingwebhookconfigurations

Fix → Fix the LimitRange defaults or the mutation rule so it produces schedulable Pods.

Prevent → Always compare the running Pod spec with the template when debugging; mutations are invisible in Git.

All Kubernetes questions Roadmap: Kubernetes core

More on Scheduling and Pending Pods