Closed
Description
Which component are you using?:
Cluster Autoscaler
What version of the component are you using?:
Component version:
What k8s version are you using (kubectl version
)?:
1.30.7
What environment is this in?:
AKS
What did you expect to happen?:
Cluster Autoscaler scale down to 2 nodes from 4
What happened instead?:
Cluster Autoscaler does not scale down nodes
How to reproduce it (as minimally and precisely as possible):
- create nodepool with w/ 4 nodes, min/max set to 4
- Running Deployment spec
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-app
labels:
app: test-app
spec:
replicas: 5
selector:
matchLabels:
app: test-app
template:
metadata:
labels:
app: test-app
spec:
nodeSelector:
agentpool: kubefabric
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"
whenUnsatisfiable: DoNotSchedule
minDomains: 2
labelSelector:
matchLabels:
app: test-app
matchLabelKeys:
- pod-template-hash
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
resources:
requests:
memory: "256Mi"
cpu: "500m" # 500m = 0.5 CPU core
limits:
memory: "512Mi"
cpu: "1" # 1 CPU core
- set min to 2, and wait for scale down. (There will be no scaledown)
- Update Deployment spec to remove topology spread constraints, observe scale down
Anything else we need to know?:
Related to Azure/AKS#4201