[Feature] Allow us to configure PodToplogySpread at a cluster level
Is your feature request related to a problem? Please describe. We would like to adjust how pod topology spread is handled to better grant HA across our nodes. This could be done at the helm chart level but then forces us to maintain this code per chart and redeploy things every time it changes. K8s supports cluster level management of this, but aks does not allow us to adjust the scheduler in this way currently.
Describe the solution you'd like https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#cluster-level-default-constraints I would like to be able to add this to an aks clusters configuration
Describe alternatives you've considered It can be overridden per app by including code in the chart, but causes us to manage it per chart and push the complexity of it upon the developer
Additional context Add any other context or screenshots about the feature request here.
Action required from @Azure/aks-pm
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Issue needing attention of @Azure/aks-leads
Also missing this feature. Would certainly improve the synergy between AKS and availability zones.
Thanks for bringing this to our attention. We have a workstream in progress to investigate these constraints and to allow them to be customized.
I'm reaching out because I have a question regarding the use of topology spread constraints at a cluster level in Azure.
Currently, we're utilizing topology spread constraints at the pod level and deployment level, which suits our needs to a certain extent. However, we have a specific requirement that goes beyond our current usage.
Our particular requirement involves migrating users from a non-zonal cluster to a zone-redundant cluster. During this migration, all pods in the existing cluster will be evicted and re-scheduled in the new cluster. We expect, post-re-scheduling, that the pods be evenly distributed among the zones and, ideally, within nodes in each zone. While even distribution across zones is a mandatory requirement, distribution within the nodes is not vital but preferred.
Taking this into account, I believe implementing a soft cluster-level strategy, specifically the 'ScheduleAnyway' under 'whenUnsatisfiable', would be an excellent way to ensure node-level distribution.
According to the official Kubernetes documentation, if no topology spread constraints are specified, the scheduler applies a built-in policy. Unfortunately, this policy is not sufficiently strict for our requirements (Please refer: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints ).
Hence, I am looking into amending the scheduler's default behavior based on Kubernetes recommendations (Further reading: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#cluster-level-default-constraints ). But it seems not supported yet. Is there a plan to release the feature recently? Hope for your response, thanks.
@darius-li you can create an admission controller or use kyverno or gatekeeper to accomplish this.
Hi all, We investigated this issue further and considered a change for the default value of maxSkew to be set to 1 for zones.
Update - we opened a PR in the Upstream scheduler - https://github.com/kubernetes/kubernetes/pull/124145 however, the change did not get merged.
Since there is already another GitHub issue - https://github.com/Azure/AKS/issues/3532 which is for a customizable scheduler, I'm marking this PR as closed as pod topology specifically was not accepted as a change through that PR.