diff --git a/charts/pipelines/templates/deployment.yaml b/charts/pipelines/templates/deployment.yaml index accbdb2..652b8da 100644 --- a/charts/pipelines/templates/deployment.yaml +++ b/charts/pipelines/templates/deployment.yaml @@ -27,7 +27,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} enableServiceLinks: false - automountServiceAccountToken: false + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken | default false }} + {{- if .Values.serviceAccount.enable }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }} + {{- end }} + containers: - name: {{ .Chart.Name }} {{- with .Values.image }} diff --git a/charts/pipelines/templates/service-account.yaml b/charts/pipelines/templates/service-account.yaml new file mode 100644 index 0000000..c37a383 --- /dev/null +++ b/charts/pipelines/templates/service-account.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.enable }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }} + labels: + {{- include "pipelines.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/pipelines/values.yaml b/charts/pipelines/values.yaml index f10b032..a1e02aa 100644 --- a/charts/pipelines/values.yaml +++ b/charts/pipelines/values.yaml @@ -38,6 +38,10 @@ persistence: selector: {} annotations: {} +serviceAccount: + enable: true + automountServiceAccountToken: false + # -- Node labels for pod assignment. nodeSelector: {}