Skip to content

Commit

Permalink
Fix 1-27 Cluster Autoscaler Reconciling Error
Browse files Browse the repository at this point in the history
kubernetes/autoscaler#4676 introduced a bug to the cluster autoscaler clusterapi reconciler.

The cluster autoscaler executable attempts to reconcile MachinePool resources, but does not have sufficient permissions to do so in its ClusterRole.
  • Loading branch information
jonathanmeier5 committed May 22, 2023
1 parent e777caa commit 028d74e
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From ce8b20934c6cba955f0b2c5ad06113588e750d30 Mon Sep 17 00:00:00 2001
From: Prow Bot <[email protected]>
Date: Mon, 22 May 2023 16:56:31 -0400
Subject: [PATCH] Authorize MachinePool Operations

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.

See: https://github.com/kubernetes/autoscaler/commit/17d2bd968e756d97598be3ffb333957f0cfe99bf#diff-c8813a0942bbcd464aaa04a04c2c71897d5df30b65a2db86cb81773016f24406R786

To resolve this issue, we authorize appropriate operations on MachinePool resources.
---
charts/cluster-autoscaler/templates/clusterrole.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/charts/cluster-autoscaler/templates/clusterrole.yaml b/charts/cluster-autoscaler/templates/clusterrole.yaml
index e3d36557f..63a65a044 100644
--- a/charts/cluster-autoscaler/templates/clusterrole.yaml
+++ b/charts/cluster-autoscaler/templates/clusterrole.yaml
@@ -152,6 +152,8 @@ rules:
resources:
- machinedeployments
- machinedeployments/scale
+ - machinepools
+ - machinepools/scale
- machines
- machinesets
verbs:
--
2.37.1 (Apple Git-137.1)

0 comments on commit 028d74e

Please sign in to comment.