Skip to content

Commit

Permalink
feat: add support for multiple expanders in v1.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshVee committed Feb 4, 2022
1 parent 994fbac commit e85b2e8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions charts/cluster-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.21.1
appVersion: 1.23.0
description: Scales Kubernetes worker nodes within autoscaling groups.
engine: gotpl
home: https://github.com/kubernetes/autoscaler
Expand All @@ -17,4 +17,4 @@ name: cluster-autoscaler
sources:
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
type: application
version: 9.13.0
version: 9.14.0
10 changes: 10 additions & 0 deletions charts/cluster-autoscaler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,13 @@ Return the service account name used by the pod.
{{ default "default" .Values.rbac.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Return true if the priority expander is enabled
*/}}
{{- define "cluster-autoscaler.priorityExpanderEnabled" -}}
{{- $expanders := splitList "," (default "" .Values.extraArgs.expander) -}}
{{- if has "priority" $expanders -}}
{{- true -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if hasKey .Values.extraArgs "expander" }}
{{- if and (.Values.expanderPriorities) (eq .Values.extraArgs.expander "priority") -}}
{{- if and (.Values.expanderPriorities) (include "cluster-autoscaler.priorityExpanderEnabled" . ) -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/cluster-autoscaler/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rules:
- configmaps
verbs:
- create
{{- if eq (default "" .Values.extraArgs.expander) "priority" }}
{{- if (include "cluster-autoscaler.priorityExpanderEnabled" . ) }}
- list
- watch
{{- end }}
Expand All @@ -22,14 +22,14 @@ rules:
- configmaps
resourceNames:
- cluster-autoscaler-status
{{- if eq (default "" .Values.extraArgs.expander) "priority" }}
{{- if (include "cluster-autoscaler.priorityExpanderEnabled" . ) }}
- cluster-autoscaler-priority-expander
{{- end }}
verbs:
- delete
- get
- update
{{- if eq (default "" .Values.extraArgs.expander) "priority" }}
{{- if (include "cluster-autoscaler.priorityExpanderEnabled" . ) }}
- watch
{{- end }}
{{- if eq (default "" (index .Values.extraArgs "leader-elect-resource-lock")) "configmaps" }}
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ image:
# image.repository -- Image repository
repository: k8s.gcr.io/autoscaling/cluster-autoscaler
# image.tag -- Image tag
tag: v1.21.1
tag: v1.23.0
# image.pullPolicy -- Image pull policy
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
Expand Down

0 comments on commit e85b2e8

Please sign in to comment.