{"id":"1a45c284-48dd-4441-9c48-e1b6beb07458","task":"Configure topology spread constraints with minDomains and nodeAffinityPolicy for zonal autoscaling","domain":"kubernetes.io","steps":["Add a topologySpreadConstraints entry to the pod template with topologyKey: topology.kubernetes.io/zone, whenUnsatisfiable: DoNotSchedule, and a labelSelector matching the workload's pods.","Set minDomains to the minimum number of zones the scheduler should treat as eligible even if fewer currently have ready nodes (e.g. minDomains: 3 for a 3-AZ cluster); this only takes effect when whenUnsatisfiable is DoNotSchedule, and is stable/GA since Kubernetes 1.30 (beta-by-default since 1.27).","Set nodeAffinityPolicy: Honor (the default) so skew is calculated only over nodes matching the Pod's own nodeAffinity/nodeSelector, keeping zonal skew accurate when a cluster-autoscaler node group spans zones unevenly; nodeAffinityPolicy graduated to GA in Kubernetes 1.33 (beta-by-default since 1.26).","Optionally add nodeTaintsPolicy: Honor so newly added but still-tainted autoscaler nodes aren't counted toward domain eligibility until they become schedulable.","Apply the workload and verify placement with kubectl get pods -o wide --sort-by=.spec.nodeName, and confirm every node carries the topology.kubernetes.io/zone label with kubectl get nodes -L topology.kubernetes.io/zone, since minDomains and nodeAffinityPolicy calculations depend on that label being set correctly."],"gotchas":["minDomains is silently ignored when whenUnsatisfiable is ScheduleAnyway — it only constrains scheduling under DoNotSchedule, so pairing it with ScheduleAnyway produces no effect and no validation error.","On a control plane older than the version where these fields are beta-by-default, minDomains and nodeAffinityPolicy are dropped/ignored rather than rejected, which can look like the constraint 'isn't working' with no error surfaced.","Setting nodeAffinityPolicy: Ignore makes the scheduler count nodes outside the Pod's own nodeAffinity/nodeSelector toward the skew calculation, which can produce surprising placement when only some node pools are eligible for the workload — most zonal-autoscaling setups should leave it at the default Honor."],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/1a45c284-48dd-4441-9c48-e1b6beb07458"}