Back to all scenarios
Scenario #92
Cluster Management
K8s v1.21, GKE
Unscheduled Pods Due to Insufficient Affinity Constraints
Pods were not scheduled due to overly strict affinity rules that limited the nodes available for deployment.
Find this helpful?
What Happened
The affinity rules were too restrictive, preventing pods from being scheduled on available nodes.
Diagnosis Steps
- 1Reviewed pod deployment spec and found strict affinity constraints.
- 2Verified available nodes and found that no nodes met the pod's affinity requirements.
Root Cause
Overly restrictive affinity settings that limited pod scheduling.
Fix/Workaround
• Adjusted the affinity rules to be less restrictive.
• Applied changes and verified the pods were scheduled correctly.
Lessons Learned
Affinity constraints should balance optimal placement with available resources.
How to Avoid
- 1Regularly review and adjust affinity/anti-affinity rules based on cluster capacity.
- 2Test deployment configurations in staging before applying to production.