Back to all scenarios
Scenario #36
Cluster Management
K8s v1.22, Azure AKS
Misconfigured NodeAffinity Excluding All Nodes
A critical deployment was unschedulable due to strict nodeAffinity rules.
Find this helpful?
What Happened
nodeAffinity required a zone that did not exist in the cluster, making all nodes invalid.
Diagnosis Steps
- 1Pod events showed 0/10 nodes available errors.
- 2Checked spec.affinity section in deployment YAML.
Root Cause
Invalid or overly strict requiredDuringScheduling nodeAffinity.
Fix/Workaround
• Updated deployment YAML to reflect actual zones.
• Re-deployed workloads.
Lessons Learned
nodeAffinity is strict and should be used carefully.
How to Avoid
- 1Validate node labels before setting affinity.
- 2Use preferredDuringScheduling for soft constraints.