File tree Expand file tree Collapse file tree 8 files changed +41
-9
lines changed Expand file tree Collapse file tree 8 files changed +41
-9
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ Create chart name and version as used by the chart label.
31
31
{ {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
32
32
{ {- end -} }
33
33
34
+ { {/*
35
+ Create the name of the service account to use
36
+ */} }
37
+ { {- define " defectdojo.serviceAccountName" -} }
38
+ { {- if .Values.serviceAccount.create -} }
39
+ { { default (include " defectdojo.fullname" .) .Values.serviceAccount.name } }
40
+ { {- else -} }
41
+ { { default " defectdojo" .Values.serviceAccount.name } }
42
+ { {- end -} }
43
+ { {- end -} }
34
44
35
45
{ {/*
36
46
Determine the hostname to use for PostgreSQL/Redis.
Original file line number Diff line number Diff line change 53
53
checksum/esecret : {{ include (print $.Template.BasePath "/extra-secret.yaml") . | sha256sum }}
54
54
{{- end }}
55
55
spec :
56
- serviceAccountName : {{ $fullName }}
56
+ serviceAccountName : {{ include "defectdojo.serviceAccountName" . }}
57
57
{{- if .Values.imagePullSecrets }}
58
58
imagePullSecrets :
59
59
- name : {{ .Values.imagePullSecrets }}
@@ -131,7 +131,7 @@ spec:
131
131
{{- if .Values.django.uwsgi.certificates.enabled }}
132
132
- name : cert-mount
133
133
mountPath : {{ .Values.django.uwsgi.certificates.certMountPath }}
134
- {{- end }}
134
+ {{- end }}
135
135
{{- range .Values.celery.extraVolumes }}
136
136
- name : userconfig-{{ .name }}
137
137
readOnly : true
Original file line number Diff line number Diff line change 53
53
checksum/esecret : {{ include (print $.Template.BasePath "/extra-secret.yaml") . | sha256sum }}
54
54
{{- end }}
55
55
spec :
56
- serviceAccountName : {{ $fullName }}
56
+ serviceAccountName : {{ include "defectdojo.serviceAccountName" . }}
57
57
{{- if .Values.imagePullSecrets }}
58
58
imagePullSecrets :
59
59
- name : {{ .Values.imagePullSecrets }}
@@ -126,7 +126,7 @@ spec:
126
126
{{- if .Values.django.uwsgi.certificates.enabled }}
127
127
- name : cert-mount
128
128
mountPath : {{ .Values.django.uwsgi.certificates.certMountPath }}
129
- {{- end }}
129
+ {{- end }}
130
130
{{- range .Values.celery.extraVolumes }}
131
131
- name : userconfig-{{ .name }}
132
132
readOnly : true
Original file line number Diff line number Diff line change 60
60
checksum/esecret : {{ include (print $.Template.BasePath "/extra-secret.yaml") . | sha256sum }}
61
61
{{- end }}
62
62
spec :
63
- serviceAccountName : {{ $fullName }}
63
+ serviceAccountName : {{ include "defectdojo.serviceAccountName" . }}
64
64
{{- if .Values.imagePullSecrets }}
65
65
imagePullSecrets :
66
66
- name : {{ .Values.imagePullSecrets }}
Original file line number Diff line number Diff line change 38
38
{{- toYaml . | nindent 8 }}
39
39
{{- end }}
40
40
spec :
41
- serviceAccountName : {{ $fullName }}
41
+ serviceAccountName : {{ include "defectdojo.serviceAccountName" . }}
42
42
{{- if .Values.imagePullSecrets }}
43
43
imagePullSecrets :
44
44
- name : {{ .Values.imagePullSecrets }}
Original file line number Diff line number Diff line change 1
- {{- $fullName := include "defectdojo.fullname" . -}}
1
+ {{- if .Values.serviceAccount.create -}}
2
2
kind : ServiceAccount
3
3
apiVersion : v1
4
4
metadata :
5
- name : {{ $fullName }}
5
+ name : {{ include "defectdojo.serviceAccountName" . }}
6
6
labels :
7
7
app.kubernetes.io/name : {{ include "defectdojo.name" . }}
8
8
app.kubernetes.io/instance : {{ .Release.Name }}
@@ -11,13 +11,20 @@ metadata:
11
11
{{- with .Values.extraLabels }}
12
12
{{- toYaml . | nindent 4 }}
13
13
{{- end }}
14
+ {{- with .Values.serviceAccount.labels }}
15
+ {{- toYaml . | nindent 4 }}
16
+ {{- end }}
14
17
annotations :
15
18
helm.sh/resource-policy : keep
16
19
helm.sh/hook : " pre-install"
17
20
helm.sh/hook-delete-policy : " before-hook-creation"
18
21
{{- with .Values.annotations }}
19
22
{{ toYaml . | nindent 4 }}
20
23
{{- end }}
24
+ {{- with .Values.serviceAccount.annotations }}
25
+ {{ toYaml . | nindent 4 }}
26
+ {{- end }}
21
27
{{- if ne .Values.gke.workloadIdentityEmail "" }}
22
28
iam.gke.io/gcp-service-account : {{ .Values.gke.workloadIdentityEmail }}
23
29
{{- end }}
30
+ {{- end }}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ metadata:
11
11
annotations :
12
12
helm.sh/hook : test-success
13
13
spec :
14
- serviceAccountName : {{ $fullName }}
14
+ serviceAccountName : {{ include "defectdojo.serviceAccountName" . }}
15
15
{{- if .Values.imagePullSecrets }}
16
16
imagePullSecrets :
17
17
- name : {{ .Values.imagePullSecrets }}
Original file line number Diff line number Diff line change @@ -84,6 +84,20 @@ securityContext:
84
84
# nginx dockerfile sets USER=1001
85
85
runAsUser : 1001
86
86
87
+ serviceAccount :
88
+ # Specifies whether a service account should be created.
89
+ create : true
90
+
91
+ # The name of the service account to use.
92
+ # If not set and create is true, a name is generated using the fullname template
93
+ # name: ""
94
+
95
+ # Optional additional annotations to add to the DefectDojo's Service Account.
96
+ annotations : {}
97
+
98
+ # Optional additional labels to add to the DefectDojo's Service Account.
99
+ labels : {}
100
+
87
101
dbMigrationChecker :
88
102
enabled : true
89
103
resources :
461
475
# When using this option, be sure to set django.ingress.activateTLS to false
462
476
useManagedCertificate : false
463
477
# Workload Identity allows the K8s service account to assume the IAM access of a GCP service account to interact with other GCP services
478
+ # Only works with serviceAccount.create = true
464
479
workloadIdentityEmail : " "
465
480
466
481
# For more advance options check the bitnami chart documentation: https://github.com/bitnami/charts/tree/master/bitnami/redis
You can’t perform that action at this time.
0 commit comments