From f3ef73206b11a2b5c82a6cb3582e803de7bc8b8a Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 26 Sep 2021 16:43:43 +0200 Subject: [PATCH] feat: add service account --- templates/deployment.yaml | 37 ++++++++++++++++++----------------- templates/serviceAccount.yaml | 4 ++++ 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 templates/serviceAccount.yaml diff --git a/templates/deployment.yaml b/templates/deployment.yaml index ef8d70c..691bb5e 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -17,12 +17,6 @@ spec: labels: {{- include "drone.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} envFrom: @@ -43,6 +37,25 @@ spec: - name: data mountPath: {{ default "/data/database.sqlite" .Values.config.DRONE_DATABASE_DATASOURCE | dir }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + serviceAccountName: {{ include "drone.fullname" . }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- if and (.Values.config.DRONE_DATABASE_DRIVER | default "sqlite3" | eq "sqlite3") .Values.persistence.existingClaim }} volumes: - name: data @@ -55,16 +68,4 @@ spec: - name: data persistentVolumeClaim: claimName: drone - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} {{- end }} \ No newline at end of file diff --git a/templates/serviceAccount.yaml b/templates/serviceAccount.yaml new file mode 100644 index 0000000..00f63d8 --- /dev/null +++ b/templates/serviceAccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "drone.fullname" . }} \ No newline at end of file