AKS icon indicating copy to clipboard operation
AKS copied to clipboard

[Feature] Allow us to configure PodToplogySpread at a cluster level

Open tepley opened this issue 4 years ago • 20 comments

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.

tepley avatar Jul 01 '22 18:07 tepley

Action required from @Azure/aks-pm

ghost avatar Jan 03 '23 01:01 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jan 18 '23 06:01 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Feb 02 '23 12:02 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Feb 17 '23 18:02 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Mar 04 '23 18:03 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Mar 20 '23 00:03 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Apr 04 '23 06:04 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Apr 19 '23 12:04 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar May 04 '23 18:05 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar May 20 '23 00:05 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jun 04 '23 00:06 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jun 19 '23 06:06 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jul 04 '23 12:07 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Jul 20 '23 00:07 ghost

Issue needing attention of @Azure/aks-leads

ghost avatar Aug 04 '23 06:08 ghost

Also missing this feature. Would certainly improve the synergy between AKS and availability zones.

fredgineer avatar Sep 19 '23 12:09 fredgineer

Thanks for bringing this to our attention. We have a workstream in progress to investigate these constraints and to allow them to be customized.

varora24 avatar Feb 12 '24 21:02 varora24

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 avatar Apr 02 '24 03:04 darius-li

@darius-li you can create an admission controller or use kyverno or gatekeeper to accomplish this.

rouke-broersma avatar Apr 02 '24 07:04 rouke-broersma

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.

varora24 avatar Apr 17 '24 21:04 varora24