From bf84a7e6acab6b6b58fdc2579192f47dd2bc4ed6 Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@hebeler.club>
Date: Tue, 28 Feb 2023 15:17:11 +0100
Subject: [PATCH] removed serviceaccount from deployment

---
 chart/templates/_helpers.tpl        | 11 -----------
 chart/templates/deployment.yaml     |  1 -
 chart/templates/serviceaccount.yaml | 12 ------------
 chart/values.yaml                   |  9 ---------
 4 files changed, 33 deletions(-)
 delete mode 100644 chart/templates/serviceaccount.yaml

diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl
index 7ba5edc..b4c3802 100644
--- a/chart/templates/_helpers.tpl
+++ b/chart/templates/_helpers.tpl
@@ -49,14 +49,3 @@ Selector labels
 app.kubernetes.io/name: {{ include "chart.name" . }}
 app.kubernetes.io/instance: {{ .Release.Name }}
 {{- end }}
-
-{{/*
-Create the name of the service account to use
-*/}}
-{{- define "chart.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "chart.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml
index e6eb2c2..add7a68 100644
--- a/chart/templates/deployment.yaml
+++ b/chart/templates/deployment.yaml
@@ -24,7 +24,6 @@ spec:
       imagePullSecrets:
         {{- toYaml . | nindent 8 }}
       {{- end }}
-      serviceAccountName: {{ include "chart.serviceAccountName" . }}
       securityContext:
         {{- toYaml .Values.podSecurityContext | nindent 8 }}
       containers:
diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml
deleted file mode 100644
index 26a57fa..0000000
--- a/chart/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- if .Values.serviceAccount.create -}}
-apiVersion: v1
-kind: ServiceAccount
-metadata:
-  name: {{ include "chart.serviceAccountName" . }}
-  labels:
-    {{- include "chart.labels" . | nindent 4 }}
-  {{- with .Values.serviceAccount.annotations }}
-  annotations:
-    {{- toYaml . | nindent 4 }}
-  {{- end }}
-{{- end }}
diff --git a/chart/values.yaml b/chart/values.yaml
index 4a2be59..f14d50d 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -15,15 +15,6 @@ imagePullSecrets:
 nameOverride: ""
 fullnameOverride: ""
 
-serviceAccount:
-  # Specifies whether a service account should be created
-  create: true
-  # Annotations to add to the service account
-  annotations: {}
-  # The name of the service account to use.
-  # If not set and create is true, a name is generated using the fullname template
-  name: ""
-
 podAnnotations: {}
 
 podSecurityContext:
-- 
GitLab