{{- if and .Values.rbac.create .Values.rbac.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
{{ include "cluster-autoscaler.labels" . | indent 4 }}
  name: {{ template "cluster-autoscaler.serviceAccountName" . }}
{{- if .Values.rbac.serviceAccount.annotations }}
  annotations: {{ toYaml .Values.rbac.serviceAccount.annotations | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.rbac.serviceAccount.automountServiceAccountToken }}
{{- end }}
