Skip to content

Commit e6d3e44

Browse files
committed
Bump cluster-autoscaler to v1.33, adjust RBAC, pin apiVersion to v1beta1
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent 79d6f0a commit e6d3e44

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

test/e2e/autoscaler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var _ = Describe("When using the autoscaler with Cluster API using ClusterClass
3636
InfrastructureMachinePoolTemplateKind: "dockermachinepooltemplates",
3737
InfrastructureMachinePoolKind: "dockermachinepools",
3838
Flavor: ptr.To("topology-autoscaler"),
39-
AutoscalerVersion: "v1.31.1",
39+
AutoscalerVersion: "v1.33.0",
4040
}
4141
})
4242
})

test/e2e/data/autoscaler/autoscaler-to-workload-workload.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ spec:
190190
# Note: The E2E test should only go up to 4 (assuming it starts with a min node group size of 2).
191191
# Using 6 for additional some buffer and to allow different starting min node group sizes.
192192
- --max-nodes-total=6
193+
env:
194+
# Per default autoscaler uses the preferred apiVersion to retrieve MachineDeployments.
195+
# If that apiVersion is v1beta2 the current autoscaler implementation is not able
196+
# to resolve infrastructureRefs as the ref format changed. This would break scale from zero.
197+
- name: CAPI_VERSION
198+
value: v1beta1
193199
volumeMounts:
194200
- name: kubeconfig-management-cluster
195201
mountPath: /management-cluster

test/framework/autoscaler_helpers.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,21 +542,31 @@ func getAuthenticationTokenForAutoscaler(ctx context.Context, managementClusterP
542542
}
543543
Expect(managementClusterProxy.GetClient().Create(ctx, sa)).To(Succeed(), fmt.Sprintf("failed to create %s service account", name))
544544

545+
var resources []string
546+
if infraMachineTemplateKind != "" {
547+
resources = append(resources, infraMachineTemplateKind)
548+
}
549+
if infraMachinePoolTemplateKind != "" {
550+
resources = append(resources, infraMachinePoolTemplateKind)
551+
}
552+
if infraMachinePoolKind != "" {
553+
resources = append(resources, infraMachinePoolKind)
554+
}
545555
role := &rbacv1.Role{
546556
ObjectMeta: metav1.ObjectMeta{
547557
Name: name,
548558
Namespace: namespace,
549559
},
550560
Rules: []rbacv1.PolicyRule{
551561
{
552-
Verbs: []string{"get", "list", "update", "watch"},
562+
Verbs: []string{"get", "list", "watch", "patch", "update"},
553563
APIGroups: []string{"cluster.x-k8s.io"},
554564
Resources: []string{"machinedeployments", "machinedeployments/scale", "machinepools", "machinepools/scale", "machines", "machinesets"},
555565
},
556566
{
557-
Verbs: []string{"get", "list"},
567+
Verbs: []string{"get", "list", "watch"},
558568
APIGroups: []string{infraAPIGroup},
559-
Resources: []string{infraMachineTemplateKind, infraMachinePoolTemplateKind, infraMachinePoolKind},
569+
Resources: resources,
560570
},
561571
},
562572
}

0 commit comments

Comments
 (0)