Improve cluster autoscaler default config (#254)

This commit is contained in:
Matt Pryor 2024-02-13 22:42:54 +00:00 committed by GitHub
parent e90f7b8670
commit d66b8a4455
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 6 deletions

View File

@ -32,6 +32,9 @@ spec:
- --kubeconfig=/mnt/kubeconfig/value
- --clusterapi-cloud-config-authoritative
- --node-group-auto-discovery=clusterapi:namespace={{ .Release.Namespace }},clusterName={{ include "openstack-cluster.clusterName" . }}
{{- range $key, $value := .Values.autoscaler.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
livenessProbe:
httpGet:
path: /health-check

View File

@ -8,7 +8,6 @@ rules:
- cluster.x-k8s.io
resources:
- machinedeployments
- machinedeployments/scale
- machines
- machinesets
verbs:
@ -16,3 +15,11 @@ rules:
- list
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinedeployments/scale
verbs:
- get
- patch
- update

View File

@ -416,14 +416,28 @@ nodeGroups:
autoscaler:
# The image to use for the autoscaler component
image:
# Defaults to the global image prefix if not given
prefix:
repository: registry.k8s.io/autoscaling/cluster-autoscaler
pullPolicy: IfNotPresent
# The cluster-autoscaler docs recommend using a version that matches the
# Kubernetes version, but versions should be (mostly) backwards-compatible
tag: v1.26.1
tag: v1.29.0
imagePullSecrets: []
# Any extra args for the autoscaler
extraArgs:
# Make sure logs go to stderr
logtostderr: true
stderrthreshold: info
# Output at a decent log level
v: 4
# Cordon nodes before terminating them so new pods are not scheduled there
cordon-node-before-terminating: "true"
# When scaling up, choose the node group that will result in the least idle CPU after
expander: least-waste,random
# Allow pods in kube-system to prevent a node from being deleted
skip-nodes-with-system-pods: "true"
# Allow pods with emptyDirs to be evicted
skip-nodes-with-local-storage: "false"
# Allow pods with custom controllers to be evicted
skip-nodes-with-custom-controller-pods: "false"
# Pod-level security context
podSecurityContext:
runAsNonRoot: true