File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -238,3 +238,14 @@ Check if list contains object
238
238
{ {- end -} }
239
239
{ {- end -} }
240
240
{ {- end -} }
241
+
242
+ { {/*
243
+ Create the name of the service account for the Cleanup CronJob to use
244
+ */} }
245
+ { {- define " kratos.cleanup.serviceAccountName" -} }
246
+ { {- if .Values.cronjob.cleanup.serviceAccount.create -} }
247
+ { {- printf " %s-cleanup" (default (include " kratos.fullname" .) .Values.cronjob.cleanup.serviceAccount.name) -} }
248
+ { {- else -} }
249
+ { {- include " kratos.serviceAccountName" . -} }
250
+ { {- end -} }
251
+ { {- end -} }
Original file line number Diff line number Diff line change 87
87
- name : {{ include "kratos.name" . }}-config-volume
88
88
mountPath : /etc/config
89
89
readOnly : true
90
+ {{- if .Values.cronjob.cleanup.extraContainers }}
91
+ {{- toYaml .Values.cronjob.cleanup.extraContainers | nindent 12 }}
92
+ {{- end }}
90
93
{{- with .Values.cronjob.cleanup.nodeSelector }}
91
94
nodeSelector :
92
95
{{- toYaml . | nindent 12 }}
@@ -103,4 +106,7 @@ spec:
103
106
affinity :
104
107
{{- toYaml . | nindent 12 }}
105
108
{{- end }}
109
+ serviceAccountName : {{ include "kratos.cleanup.serviceAccountName" . }}
110
+ automountServiceAccountToken : {{ .Values.cronjob.cleanup.automountServiceAccountToken }}
111
+ shareProcessNamespace : {{ .Values.cronjob.cleanup.shareProcessNamespace }}
106
112
{{- end }}
Original file line number Diff line number Diff line change
1
+ {{- if .Values.cronjob.cleanup.serviceAccount.create -}}
2
+ ---
3
+ apiVersion : v1
4
+ kind : ServiceAccount
5
+ metadata :
6
+ name : {{ include "kratos.cleanup.serviceAccountName" . }}
7
+ {{- if .Release.Namespace }}
8
+ namespace : {{ .Release.Namespace }}
9
+ {{- end }}
10
+ labels :
11
+ {{- include "kratos.labels" . | nindent 4 }}
12
+ {{- with .Values.cronjob.cleanup.serviceAccount.annotations }}
13
+ annotations :
14
+ {{- toYaml . | nindent 4 }}
15
+ {{- end }}
16
+ automountServiceAccountToken : {{ .Values.cronjob.cleanup.automountServiceAccountToken }}
17
+ {{- end -}}
Original file line number Diff line number Diff line change @@ -695,6 +695,32 @@ cronjob:
695
695
# -- Set custom cron job level annotations
696
696
annotations : {}
697
697
698
+ # -- If you want to add extra sidecar containers.
699
+ extraContainers : []
700
+ # extraContainers: |
701
+ # - name: cloud-sql-proxy
702
+ # image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.18.0
703
+ # command: ["/cloud_sql_proxy"]
704
+ # args: ["--port=5432", "--exit-zero-on-sigterm", "myproject:myregion:myinstance"]
705
+
706
+ # -- Set automounting of the SA token
707
+ automountServiceAccountToken : false
708
+
709
+ # -- Set sharing process namespace
710
+ shareProcessNamespace : false
711
+
712
+ # -- Specify the serviceAccountName value.
713
+ # Sometime you need to provide specific permissions for the cleanup cronjob.
714
+ # For example installing Kratos on a cluster with a PosSecurityPolicy and Istio.
715
+ # Uncomment if you need to provide a ServiceAccount for the cleanup cronjob.
716
+ serviceAccount :
717
+ # -- Specifies whether a service account should be created
718
+ create : true
719
+ # -- Annotations to add to the service account
720
+ annotations : {}
721
+ # -- The name of the service account to use. If not set and create is true, a name is generated using the fullname template
722
+ name : " "
723
+
698
724
# -- Specify pod metadata, this metadata is added directly to the pod, and not higher objects
699
725
podMetadata :
700
726
# -- Extra pod level labels
You can’t perform that action at this time.
0 commit comments