diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 394a0be6d268..c5219cf940d0 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.29.3 +version: 9.29.4 diff --git a/charts/cluster-autoscaler/templates/secret.yaml b/charts/cluster-autoscaler/templates/secret.yaml index 9c58d0feb1a6..5096a2249b27 100644 --- a/charts/cluster-autoscaler/templates/secret.yaml +++ b/charts/cluster-autoscaler/templates/secret.yaml @@ -1,11 +1,16 @@ -{{- if or (eq .Values.cloudProvider "azure") (and (eq .Values.cloudProvider "aws") (not (has "" (list .Values.awsAccessKeyID .Values.awsSecretAccessKey)))) }} +{{- if not .Values.secretKeyRefNameOverride }} +{{- $isAzure := eq .Values.cloudProvider "azure" }} +{{- $isAws := eq .Values.cloudProvider "aws" }} +{{- $awsCredentialsProvided := and .Values.awsAccessKeyID .Values.awsSecretAccessKey }} + +{{- if or $isAzure (and $isAws $awsCredentialsProvided) }} apiVersion: v1 kind: Secret metadata: name: {{ template "cluster-autoscaler.fullname" . }} namespace: {{ .Release.Namespace }} data: -{{- if eq .Values.cloudProvider "azure" }} +{{- if $isAzure }} ClientID: "{{ .Values.azureClientID | b64enc }}" ClientSecret: "{{ .Values.azureClientSecret | b64enc }}" ResourceGroup: "{{ .Values.azureResourceGroup | b64enc }}" @@ -14,8 +19,9 @@ data: VMType: "{{ .Values.azureVMType | b64enc }}" ClusterName: "{{ .Values.azureClusterName | b64enc }}" NodeResourceGroup: "{{ .Values.azureNodeResourceGroup | b64enc }}" -{{- else if eq .Values.cloudProvider "aws" }} +{{- else if $isAws }} AwsAccessKeyId: "{{ .Values.awsAccessKeyID | b64enc }}" AwsSecretAccessKey: "{{ .Values.awsSecretAccessKey | b64enc }}" {{- end }} {{- end }} +{{- end }}