Skip to content

🐛 Bump cluster-autoscaler to v1.33, adjust RBAC, pin apiVersion to v1beta1 #12502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ = Describe("When using the autoscaler with Cluster API using ClusterClass
InfrastructureMachinePoolTemplateKind: "dockermachinepooltemplates",
InfrastructureMachinePoolKind: "dockermachinepools",
Flavor: ptr.To("topology-autoscaler"),
AutoscalerVersion: "v1.31.1",
AutoscalerVersion: "v1.33.0",
}
})
})
14 changes: 14 additions & 0 deletions test/e2e/data/autoscaler/autoscaler-to-workload-workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ rules:
- get
- list
- watch
- apiGroups:
- "storage.k8s.io"
resources:
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -190,6 +198,12 @@ spec:
# Note: The E2E test should only go up to 4 (assuming it starts with a min node group size of 2).
# Using 6 for additional some buffer and to allow different starting min node group sizes.
- --max-nodes-total=6
env:
# Per default autoscaler uses the preferred apiVersion to retrieve MachineDeployments.
# If that apiVersion is v1beta2 the current autoscaler implementation is not able
# to resolve infrastructureRefs as the ref format changed. This would break scale from zero.
- name: CAPI_VERSION
value: v1beta1
volumeMounts:
- name: kubeconfig-management-cluster
mountPath: /management-cluster
Expand Down
16 changes: 13 additions & 3 deletions test/framework/autoscaler_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,21 +542,31 @@ func getAuthenticationTokenForAutoscaler(ctx context.Context, managementClusterP
}
Expect(managementClusterProxy.GetClient().Create(ctx, sa)).To(Succeed(), fmt.Sprintf("failed to create %s service account", name))

var resources []string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to avoid empty strings in the Role

if infraMachineTemplateKind != "" {
resources = append(resources, infraMachineTemplateKind)
}
if infraMachinePoolTemplateKind != "" {
resources = append(resources, infraMachinePoolTemplateKind)
}
if infraMachinePoolKind != "" {
resources = append(resources, infraMachinePoolKind)
}
role := &rbacv1.Role{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Rules: []rbacv1.PolicyRule{
{
Verbs: []string{"get", "list", "update", "watch"},
Verbs: []string{"get", "list", "watch", "patch", "update"},
APIGroups: []string{"cluster.x-k8s.io"},
Resources: []string{"machinedeployments", "machinedeployments/scale", "machinepools", "machinepools/scale", "machines", "machinesets"},
},
{
Verbs: []string{"get", "list"},
Verbs: []string{"get", "list", "watch"},
APIGroups: []string{infraAPIGroup},
Resources: []string{infraMachineTemplateKind, infraMachinePoolTemplateKind, infraMachinePoolKind},
Resources: resources,
},
},
}
Expand Down