[Feature] Allow Scale Down of nodes with system pods annotated as safe to evict
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 395
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 13
Description
**Is your feature request related to a problem? Please describe.**
Currently, AKS Cluster Autoscaler blocks scale down of nodes hosting system pods that are not part of a DaemonSet, even if these pods are safe to evict and can be rescheduled elsewhere (e.g., protected by a PodDisruptionBudget). This behavior prevents scale down in scenarios where system pods are actually safe to move, leading to inefficient resource usage.
In my use case, I want to disable scale down entirely if nodes are not empty, because some applications hosted on the cluster are not replicated and cannot be interrupted. However, I do not want system pods to block scale down as they are safe to evict.
**Describe the solution you'd like**
It would be very useful to have a way to parametrize system pods so that they are ignored by the scale down process, for example by supporting an annotation such as:
`cluster-autoscaler.kubernetes.io/safe-to-evict: "true"`
This would allow system pods to opt-in for scale down, improving flexibility and resource efficiency. Please consider adding support for this annotation in the AKS Cluster Autoscaler.
**Describe alternatives you've considered**
Configuring autoscaler profile in AKS didn't help me tackle the issue: the `skip-nodes-with-system-pods` option can be configured to include nodes with system pods in the scale-down process, but it still doesn't ignore resources reservation from these pods when evaluating the `scale-down-utilization-threshold`.
Contributor guide
Research direction
Start by tracing the AKS Cluster Autoscaler scale-down evaluation, focusing on how system pods and the safe-to-evict annotation are handled. Review the skip-nodes-with-system-pods and scale-down-utilization-threshold behavior described in the issue; done means an explicitly safe-to-evict system pod no longer blocks eligible scale-down decisions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, kubernetes
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100