From f33f490abc123f3d3171834c02c38b06a326ac1d Mon Sep 17 00:00:00 2001 From: Tim Hobbs Date: Tue, 23 Sep 2025 14:37:28 +0200 Subject: [PATCH 1/3] Allow VPA recommenders for Cluster Autoscaler --- charts/cluster-autoscaler/Chart.yaml | 2 +- charts/cluster-autoscaler/README.md | 3 +++ charts/cluster-autoscaler/templates/vpa.yaml | 3 +++ charts/cluster-autoscaler/values.yaml | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 05a09a218bbf..3b32a71a62ef 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.50.1 +version: 9.51.0 diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 8b97032622ac..8d85951d5a91 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -421,6 +421,8 @@ vpa: minAllowed: cpu: 20m memory: 50Mi + recommenders: + - name: default ``` ## Values @@ -536,4 +538,5 @@ vpa: | vpa | object | `{"containerPolicy":{},"enabled":false,"updateMode":"Auto"}` | Configure a VerticalPodAutoscaler for the cluster-autoscaler Deployment. | | vpa.containerPolicy | object | `{}` | [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. | | vpa.enabled | bool | `false` | If true, creates a VerticalPodAutoscaler. | +| vpa.recommenders | list | `[]` | List of recommender selectors that will apply to this VerticalPodAutoscaler. An empty list uses the `default` recommender. | | vpa.updateMode | string | `"Auto"` | [UpdateMode](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L124) | diff --git a/charts/cluster-autoscaler/templates/vpa.yaml b/charts/cluster-autoscaler/templates/vpa.yaml index b889beac9c9a..66301d0d0cc2 100644 --- a/charts/cluster-autoscaler/templates/vpa.yaml +++ b/charts/cluster-autoscaler/templates/vpa.yaml @@ -13,6 +13,9 @@ spec: name: {{ template "cluster-autoscaler.fullname" . }} updatePolicy: updateMode: {{ .Values.vpa.updateMode | quote }} + {{- with .Values.vpa.recommenders }} + recommenders: {{- . | toYaml | nindent 4 }} + {{- end }} resourcePolicy: containerPolicies: - containerName: {{ template "cluster-autoscaler.name" . }} diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 50865497fb20..9259a1e04410 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -489,6 +489,10 @@ vpa: updateMode: "Auto" # vpa.containerPolicy -- [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. containerPolicy: {} + # vpa.recommenders -- VPA recommenders that will provide recommendations for vertical scaling + # When the recommenders list is empty, the recommender 'default' is used + recommenders: [] + # - name: my-recommender # secretKeyRefNameOverride -- Overrides the name of the Secret to use when loading the secretKeyRef for AWS, Azure and Civo env variables secretKeyRefNameOverride: "" From 7afff7e34592954057de94a3f8fb452d648b5417 Mon Sep 17 00:00:00 2001 From: Tim Hobbs Date: Wed, 1 Oct 2025 11:53:08 +0200 Subject: [PATCH 2/3] chore: incorporate suggestions --- charts/cluster-autoscaler/README.md | 4 +--- charts/cluster-autoscaler/templates/vpa.yaml | 5 ++--- charts/cluster-autoscaler/values.yaml | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 8d85951d5a91..6fa874145a55 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -421,8 +421,6 @@ vpa: minAllowed: cpu: 20m memory: 50Mi - recommenders: - - name: default ``` ## Values @@ -538,5 +536,5 @@ vpa: | vpa | object | `{"containerPolicy":{},"enabled":false,"updateMode":"Auto"}` | Configure a VerticalPodAutoscaler for the cluster-autoscaler Deployment. | | vpa.containerPolicy | object | `{}` | [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. | | vpa.enabled | bool | `false` | If true, creates a VerticalPodAutoscaler. | -| vpa.recommenders | list | `[]` | List of recommender selectors that will apply to this VerticalPodAutoscaler. An empty list uses the `default` recommender. | +| vpa.recommender | string | `"default"` | Name of the recommender that will apply to this VerticalPodAutoscaler. | | vpa.updateMode | string | `"Auto"` | [UpdateMode](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L124) | diff --git a/charts/cluster-autoscaler/templates/vpa.yaml b/charts/cluster-autoscaler/templates/vpa.yaml index 66301d0d0cc2..b0404113416a 100644 --- a/charts/cluster-autoscaler/templates/vpa.yaml +++ b/charts/cluster-autoscaler/templates/vpa.yaml @@ -13,9 +13,8 @@ spec: name: {{ template "cluster-autoscaler.fullname" . }} updatePolicy: updateMode: {{ .Values.vpa.updateMode | quote }} - {{- with .Values.vpa.recommenders }} - recommenders: {{- . | toYaml | nindent 4 }} - {{- end }} + recommenders: + - name: {{ .Values.vpa.recommender | quote }} resourcePolicy: containerPolicies: - containerName: {{ template "cluster-autoscaler.name" . }} diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 9259a1e04410..147874a585da 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -489,10 +489,8 @@ vpa: updateMode: "Auto" # vpa.containerPolicy -- [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. containerPolicy: {} - # vpa.recommenders -- VPA recommenders that will provide recommendations for vertical scaling - # When the recommenders list is empty, the recommender 'default' is used - recommenders: [] - # - name: my-recommender + # vpa.recommender -- Name of the VPA recommender that will provide recommendations for vertical scaling. + recommender: default # secretKeyRefNameOverride -- Overrides the name of the Secret to use when loading the secretKeyRef for AWS, Azure and Civo env variables secretKeyRefNameOverride: "" From cd45fe71cfacff93dc3132f50aee7c245c3ba7c6 Mon Sep 17 00:00:00 2001 From: Tim Hobbs Date: Wed, 1 Oct 2025 11:54:40 +0200 Subject: [PATCH 3/3] lint --- charts/cluster-autoscaler/templates/vpa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/templates/vpa.yaml b/charts/cluster-autoscaler/templates/vpa.yaml index b0404113416a..560dab00a4de 100644 --- a/charts/cluster-autoscaler/templates/vpa.yaml +++ b/charts/cluster-autoscaler/templates/vpa.yaml @@ -14,7 +14,7 @@ spec: updatePolicy: updateMode: {{ .Values.vpa.updateMode | quote }} recommenders: - - name: {{ .Values.vpa.recommender | quote }} + - name: {{ .Values.vpa.recommender | quote }} resourcePolicy: containerPolicies: - containerName: {{ template "cluster-autoscaler.name" . }}