Skip to content

Commit 33d5942

Browse files
authored
fix: Ensure ClusterAutoscaler can write status CM in workload cluster (#864)
Previously workload ClusterAutoscaler deployments were configured to write the status configmap to the same namesapce as the workload cluster is in on the management cluster. However, ClusterAutoscaler actually writes this configmap and acquires a lock in the specified namespace in the workload cluster. If that namespace does not exist then CA will fail to run correctly, repeatedly throwing the error `error initially creating leader election record: namespaces "my-new-ns" not found`. This commit updates the target namespace to use the default `kube-system` which always exists on all clusters. This is the CA default and as such is completely safe to use.
1 parent d7cf7bf commit 33d5942

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

charts/cluster-api-runtime-extensions-nutanix/templates/cluster-autoscaler/manifests/cluster-autoscaler-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ data:
168168
- command:
169169
- ./cluster-autoscaler
170170
- --cloud-provider=clusterapi
171-
- --namespace='{{ `{{ .Cluster.Namespace }}` }}'
171+
- --namespace=kube-system
172172
- --node-group-auto-discovery=clusterapi:clusterName='{{ `{{ .Cluster.Name }}` }}',namespace='{{ `{{ .Cluster.Namespace }}` }}'
173173
- --kubeconfig=/cluster/kubeconfig
174174
- --clusterapi-cloud-config-authoritative

charts/cluster-api-runtime-extensions-nutanix/templates/cluster-autoscaler/manifests/helm-addon-installation.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ data:
2929
labels:
3030
- namespace: "{{ `{{ .Cluster.Namespace }}` }}"
3131
32-
clusterAPIConfigMapsNamespace: "{{ `{{ .Cluster.Namespace }}` }}"
3332
# For workload clusters it is not possible to use the in-cluster client.
3433
# To simplify the configuration, use the admin kubeconfig generated by CAPI for all clusters.
3534
clusterAPIMode: kubeconfig-incluster

hack/addons/kustomize/cluster-autoscaler/helm-values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ autoDiscovery:
2525
labels:
2626
- namespace: tmpl-clusternamespace-tmpl
2727

28-
clusterAPIConfigMapsNamespace: tmpl-clusternamespace-tmpl
2928
# For workload clusters it is not possible to use the in-cluster client.
3029
# To simplify the configuration, use the admin kubeconfig generated by CAPI for all clusters.
3130
clusterAPIMode: kubeconfig-incluster

0 commit comments

Comments
 (0)