Avoiding Kubernetes Pod Topology Spread Constraint Pitfalls
Kubernetes Pod Topology Spread Constraints with a naive LabelSelector (e.g. just the app label) can produce heavy zone skew during rolling updates, because kube-scheduler counts Pods from both old and new ReplicaSets and never rebalances when old Pods are randomly terminated. In the worst case an Availability Zone outage could take out 2/3 of a service's Pods instead of 1/3. Wise fixed this with a mutating admission webhook that adds a per-ReplicaSet UUID label to Pods and to the constraint's LabelSelector, so only new-version Pods are considered. Alternatives include manifest tooling changes, the alpha matchLabelKeys field with pod-template-hash in Kubernetes 1.25, descheduler for scale-down imbalance, or per-zone deployments or clusters.
Related posts
- Kubernetes v1.37: Advancing Workload-Aware Scheduling
Kubernetes Blog hardMasterKubernetes v1.37 promotes the Workload and PodGroup APIs (gang scheduling), workload-aware preemption and shared DRA ResourceClaims for PodGroups to Beta. It also adds an alpha CompositePodGroup API for hierarchical, multi-level gang scheduling, preemption and topology constraints, aimed at structures like JobSet and LeaderWorkerSet. PodGroups are now queued as single units, minCount is mutable for elastic workloads, and preemption runs the scheduling algorithm once instead of per victim reprieval and now respects PodGroup disruptionMode (renamed to all/single). Multi-level topology constraints are resolved top-down, for example zone at the root and rack for child groups, and a new workloadbuilder Go library helps controllers integrate.
- Kubernetes v1.37: Scheduler Preemption for In-Place Pod Resize (Alpha)
Kubernetes Blog mediumAdeptKubernetes v1.37 adds alpha scheduler preemption for in-place Pod resize behind the InPlacePodVerticalScalingSchedulerPreemption feature gate. Running Pods whose scale-up is Deferred for lack of node headroom are now tracked by kube-scheduler, which preempts lower-priority Pods on that same node, respecting PDBs and graceful termination, while treating the requested resize resources as already reserved. The Kubelet's critical Pod admission handler no longer evicts locally for resizes, so the scheduler makes every resize preemption decision. A new Node spec.podPreemptionPolicy field lets autoscalers opt nodes out, and a kind-based walkthrough shows a deferred CPU resize completing after a low-priority Pod is preempted.
- Kubernetes v1.36: Advancing Workload-Aware Scheduling
Kubernetes Blog hardMasterKubernetes v1.36 splits workload scheduling into a static Workload template and a runtime PodGroup API (scheduling.k8s.io/v1alpha2). kube-scheduler gains a PodGroup scheduling cycle that snapshots cluster state once and places or rejects a whole group atomically, which is the basis for gang scheduling. The release also adds rack-style topology-aware placement through new PlacementGenerate/PlacementScore extension points, and cluster-wide workload-aware preemption with group priority and disruptionMode. DRA ResourceClaims can now be generated and reserved per PodGroup, lifting the 256-entry reservedFor limit, and the Job controller can create Workload and PodGroup objects automatically behind the WorkloadWithJob gate. Known limits: placement is not guaranteed for heterogeneous groups or groups with inter-Pod dependencies.
- Kubernetes v1.37: Pod-Level Resource Managers graduated to Beta
Kubernetes Blog hardMasterKubernetes v1.37 promotes Pod-Level Resource Managers to Beta behind the `PodLevelResourceManagers` feature gate, disabled by default. The feature lets the kubelet's Topology, CPU and Memory Managers use pod-level `.spec.resources` for placement, so primary containers get exclusive NUMA-aligned cores while non-Guaranteed sidecars share a pod-isolated pool without dedicated physical cores. Beta also adds top-level `cpu_ids` and `memory` fields to the v1 PodResources gRPC API, letting monitoring tools and device plugins read pod-level exclusive assignments without double-counting container allocations.
- A Recap on May/June Stability
Neon mediumAdept
Neon's May and June 2025 incidents were caused by a load surge from agentic AI platforms. Database creation rose more than 5x and branch creation more than 50x. In May, US regions hit Kubernetes scaling limits around 10,000–12,000 concurrent database pods: EKS etcd memory, pod start times, network configuration and API rate limits. Stopgap tuning raised risk until the horizontally scaled "Cells" architecture shipped. In June, branch metadata growth in the Postgres-backed control plane caused query plan drift, vacuum pressure and expensive billing queries. Fixes include stricter limits on every workload dimension, tests with high-branch-count scenarios, defensive query rewrites, moving billing data to an analytical store, and splitting start/suspend hot-path logic into a small isolated service.