OpsCanary
kubernetesschedulingPractitioner

Taming Pod Distribution Drift in EKS with the Kubernetes Descheduler

5 min read AWS Containers BlogSep 28, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

In a dynamic Kubernetes environment, pods can become unevenly distributed across nodes, especially in multi-AZ setups. This drift can lead to resource contention and underutilization, impacting your application's performance. The Kubernetes descheduler addresses this issue by periodically evaluating pod placement against defined policies and rebalancing workloads to ensure optimal distribution.

The descheduler operates on a loop, checking the current state of the cluster and evicting pods that violate your specified policies. It uses the Eviction API, which means that PodDisruptionBudgets (PDBs) are respected during this process. One key feature is the use of topologySpreadConstraints, which allows you to define how pods should be distributed across different domains, such as Availability Zones. For instance, you can set a maxSkew of 1, meaning the difference in pod count between the busiest and least-busy zone should not exceed one. You can also choose between soft constraints (ScheduleAnyway) that allow for some flexibility in pod placement and hard constraints (DoNotSchedule) that enforce strict rules.

In production, you need to be mindful of the descheduler's configuration. The topologyBalanceNodeFit parameter, which defaults to true, prevents evictions when there is no better placement available. This can help avoid unnecessary disruptions. However, be aware that while the descheduler is powerful, it may not be the silver bullet for all distribution issues. Always monitor your cluster's performance and adjust your policies as needed to ensure they align with your workload requirements.

Key takeaways

  • →Implement topologySpreadConstraints to control pod distribution across zones.
  • →Set maxSkew to define the maximum allowed difference in pod counts.
  • →Use ScheduleAnyway for soft constraints to allow flexibility in pod placement.
  • →Respect PodDisruptionBudgets during pod evictions to maintain service availability.
  • →Configure topologyBalanceNodeFit to prevent unnecessary evictions.

Why it matters

Maintaining balanced pod distribution is crucial for resource optimization and application performance. An uneven distribution can lead to hotspots, causing some nodes to be over-utilized while others remain idle, which can degrade service quality.

Code examples

YAML
1topologySpreadConstraints:
2- maxSkew: 1
3  topologyKey: topology.kubernetes.io/zone
4  whenUnsatisfiable: ScheduleAnyway  # soft
5  labelSelector:
6    matchLabels:
7      app: web

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Linux FoundationSponsor

Industry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.

Get CKA certified →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.