Skip to content

Commit 3726eca

Browse files
authored
add patch to access machinetemplate and other component (#5229)
1 parent 223072a commit 3726eca

4 files changed

Lines changed: 43 additions & 3 deletions

File tree

projects/kubernetes/autoscaler/1-35/helm/patches/0001-Set-CAPI-as-default-cloud-provider.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From c97111ab94b127383135dc718ff89927724adfbb Mon Sep 17 00:00:00 2001
22
From: Prow Bot <prow@amazonaws.com>
33
Date: Sun, 20 Apr 2025 20:53:39 -0700
4-
Subject: [PATCH 1/3] Set-CAPI-as-default-cloud-provider
4+
Subject: [PATCH 1/4] Set-CAPI-as-default-cloud-provider
55

66
---
77
cluster-autoscaler/charts/cluster-autoscaler/values.yaml | 2 +-

projects/kubernetes/autoscaler/1-35/helm/patches/0002-Add-image-values.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From a7dee99f9ad612022fa0e8a20435cdd31e06e0ac Mon Sep 17 00:00:00 2001
22
From: Prow Bot <prow@amazonaws.com>
33
Date: Tue, 1 Oct 2024 13:51:45 -0700
4-
Subject: [PATCH 2/3] Add image values
4+
Subject: [PATCH 2/4] Add image values
55

66
---
77
.../templates/deployment.yaml | 12 +++++-------

projects/kubernetes/autoscaler/1-35/helm/patches/0003-Authorize-MachinePool-Operations.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From e098a3998cfa2c4a050cb4c5e3e7a3b9b499f416 Mon Sep 17 00:00:00 2001
22
From: Prow Bot <prow@amazonaws.com>
33
Date: Mon, 22 May 2023 16:56:31 -0400
4-
Subject: [PATCH 3/3] Authorize MachinePool Operations
4+
Subject: [PATCH 3/4] Authorize MachinePool Operations
55

66
https://github.com/kubernetes/autoscaler/pull/4676 Introduced a bug where the autoscaler runtime fails to reconcile other CAPI machine resources when its ClusterRole is not authorized to list and watch MachinePool resources.
77

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Amelia Lu <peirulu@amazon.com>
3+
Date: Thu, 05 Mar 2026 13:54:00 -0800
4+
Subject: [PATCH 4/4] Authorize Infrastructure Machine Templates for Scale from
5+
Zero
6+
7+
Cluster Autoscaler 1.35 introduced changes that require RBAC permissions
8+
to access infrastructure machine templates (e.g., vspheremachinetemplates)
9+
for the scale-from-zero feature. Without these permissions, the autoscaler
10+
fails with:
11+
12+
"vspheremachinetemplates.infrastructure.cluster.x-k8s.io is forbidden"
13+
14+
This is documented in the upstream CAPI provider README:
15+
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#rbac-changes-for-scaling-from-zero
16+
---
17+
.../cluster-autoscaler/templates/clusterrole.yaml | 8 ++++++++
18+
1 file changed, 8 insertions(+)
19+
20+
diff --git a/cluster-autoscaler/charts/cluster-autoscaler/templates/clusterrole.yaml b/cluster-autoscaler/charts/cluster-autoscaler/templates/clusterrole.yaml
21+
index 1a6f68cdc..2b3c89f01 100644
22+
--- a/cluster-autoscaler/charts/cluster-autoscaler/templates/clusterrole.yaml
23+
+++ b/cluster-autoscaler/charts/cluster-autoscaler/templates/clusterrole.yaml
24+
@@ -175,6 +175,14 @@ rules:
25+
- get
26+
- patch
27+
- update
28+
+ - apiGroups:
29+
+ - infrastructure.cluster.x-k8s.io
30+
+ resources:
31+
+ - '*'
32+
+ verbs:
33+
+ - get
34+
+ - list
35+
+ - watch
36+
{{- end }}
37+
{{- if .Values.rbac.additionalRules }}
38+
{{ toYaml .Values.rbac.additionalRules | indent 2 }}
39+
--
40+
2.34.1

0 commit comments

Comments
 (0)