Skip to content

Commit 7cfb90d

Browse files
authored
Fix cluster-autoscaler (#561)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated Cluster Autoscaler to version 1.32.0 - Added new configuration options for more granular node scaling and management - Introduced custom patch for scaling behavior - **Improvements** - Upgraded Go build environment to version 1.23.4 - Switched to latest Cluster Autoscaler image tag - Enhanced node scaling flexibility with new command-line arguments - **Technical Updates** - Modified cluster autoscaler deployment configuration - Updated image references and build process <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 26388c7 commit 7cfb90d

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ghcr.io/aenix-io/cozystack/cluster-autoscaler:0.14.1@sha256:0ea139c71e08db5adb275d81a7efa9a0d8b8db61a1fc1a67167a33a347c07fd8
1+
ghcr.io/aenix-io/cozystack/cluster-autoscaler:latest@sha256:a8035edb5abee8e88c9153ea4f612d03f490c9bba757c2e57f61ae66cc6fe972

‎packages/apps/kubernetes/images/cluster-autoscaler/Dockerfile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Source: https://raw.githubusercontent.com/kubernetes/autoscaler/refs/heads/master/cluster-autoscaler/Dockerfile.amd64
2-
ARG builder_image=docker.io/library/golang:1.22.5
2+
ARG builder_image=docker.io/library/golang:1.23.4
33
ARG BASEIMAGE=gcr.io/distroless/static:nonroot-amd64
44
FROM ${builder_image} AS builder
55
RUN git clone https://github.com/kubernetes/autoscaler /src/autoscaler \
66
&& cd /src/autoscaler/cluster-autoscaler \
7-
&& git checkout cluster-autoscaler-1.31.0
7+
&& git checkout cluster-autoscaler-1.32.0
88

99
WORKDIR /src/autoscaler/cluster-autoscaler
10+
COPY fix-downscale.diff /fix-downscale.diff
11+
RUN git apply /fix-downscale.diff
1012
RUN make build
1113

1214
FROM $BASEIMAGE
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go
2+
index 4eec0e4bf..f28fd9241 100644
3+
--- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go
4+
+++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go
5+
@@ -106,8 +106,6 @@ func (r unstructuredScalableResource) Replicas() (int, error) {
6+
7+
func (r unstructuredScalableResource) SetSize(nreplicas int) error {
8+
switch {
9+
- case nreplicas > r.maxSize:
10+
- return fmt.Errorf("size increase too large - desired:%d max:%d", nreplicas, r.maxSize)
11+
case nreplicas < r.minSize:
12+
return fmt.Errorf("size decrease too large - desired:%d min:%d", nreplicas, r.minSize)
13+
}

‎packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ spec:
3030
- /cluster-autoscaler
3131
args:
3232
- --cloud-provider=clusterapi
33+
- --enforce-node-group-min-size=true
34+
- --ignore-daemonsets-utilization=true
35+
- --ignore-mirror-pods-utilization=true
36+
- --scale-down-unneeded-time=30s
37+
- --scan-interval=25s
38+
- --force-delete-unregistered-nodes=true
3339
- --kubeconfig=/etc/kubernetes/kubeconfig/super-admin.svc
3440
- --clusterapi-cloud-config-authoritative
3541
- --node-group-auto-discovery=clusterapi:namespace={{ .Release.Namespace }},clusterName={{ .Release.Name }}

0 commit comments

Comments
 (0)