diff --git a/chart/keel/Chart.yaml b/chart/keel/Chart.yaml index 78c63a4d..306acc1e 100644 --- a/chart/keel/Chart.yaml +++ b/chart/keel/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: keel description: Open source, tool for automating Kubernetes deployment updates. Keel is stateless, robust and lightweight. -version: 0.8.16 +version: 0.8.17 # Note that we use appVersion to get images tag, so make sure this is correct. appVersion: 0.15.0-rc1 keywords: diff --git a/chart/keel/templates/_helpers.tpl b/chart/keel/templates/_helpers.tpl index 06f9476d..9df65551 100644 --- a/chart/keel/templates/_helpers.tpl +++ b/chart/keel/templates/_helpers.tpl @@ -6,6 +6,14 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "serviceAccount.name" -}} +{{- if .Values.rbac.serviceAccount.name -}} +{{- .Values.rbac.serviceAccount.name -}} +{{- else -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/chart/keel/templates/clusterrolebinding.yaml b/chart/keel/templates/clusterrolebinding.yaml index e443cb16..54e1a849 100644 --- a/chart/keel/templates/clusterrolebinding.yaml +++ b/chart/keel/templates/clusterrolebinding.yaml @@ -9,6 +9,6 @@ roleRef: name: {{ template "keel.name" . }} subjects: - kind: ServiceAccount - name: {{ template "keel.name" . }} + name: {{ template "serviceAccount.name" . }} namespace: {{ .Release.Namespace }} {{ end }} diff --git a/chart/keel/templates/deployment.yaml b/chart/keel/templates/deployment.yaml index 85e65816..64d152a3 100644 --- a/chart/keel/templates/deployment.yaml +++ b/chart/keel/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} spec: - serviceAccountName: {{ template "keel.name" . }} + serviceAccountName: {{ template "serviceAccount.name" . }} containers: - name: keel # Note that we use appVersion to get images tag. diff --git a/chart/keel/templates/service-account.yaml b/chart/keel/templates/service-account.yaml index 51344435..b862fd03 100644 --- a/chart/keel/templates/service-account.yaml +++ b/chart/keel/templates/service-account.yaml @@ -1,7 +1,8 @@ +{{- if .Values.rbac.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ template "keel.name" . }} + name: {{ template "serviceAccount.name" . }} namespace: {{ .Release.Namespace }} {{- if (and .Values.ecr.enabled .Values.ecr.roleArn) }} annotations: @@ -12,3 +13,4 @@ metadata: chart: {{ template "keel.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} +{{ end }} \ No newline at end of file diff --git a/chart/keel/values.yaml b/chart/keel/values.yaml index 00b485d9..731fc9ca 100644 --- a/chart/keel/values.yaml +++ b/chart/keel/values.yaml @@ -130,6 +130,12 @@ keel: # RBAC manifests management rbac: enabled: true + serviceAccount: + # Kubernetes service account name to be used for ClusterRoleBinding and Deployment. + # name: + # Create a new Kubernetes service account automatically. Set to false if you want to use your own service account. + # If rbac.serviceAccount.name is not set, a new name for the service account is generated + create: true # Resources resources: