@@ -16,84 +16,117 @@ metadata:
1616 {{- end }}
1717spec :
1818 concurrencyPolicy : Forbid
19- successfulJobsHistoryLimit : 1 # remove jobs which are successfully executed
20- failedJobsHistoryLimit : 1 # except 1 recent failed job, remove jobs which are not successfully executed
21- # schedule: '*/3 * * * *' # cron spec of time
19+ successfulJobsHistoryLimit : 1
20+ failedJobsHistoryLimit : 1
2221 schedule : {{ $.Values.crontime }}
2322 jobTemplate :
2423 spec :
25- backoffLimit : 0 # this has very low chance of failing, as all this does
26- # is prompt kubernetes to schedule new replica set for
27- # the deployment
28- # activeDeadlineSeconds: 600 # timeout, makes most sense with
29- # "waiting for rollout" variant specified below
24+ backoffLimit : 0
3025 template :
3126 spec :
32- # account configured above
3327 serviceAccountName : {{ template "uitestrig.serviceAccountName" $ }}
3428 restartPolicy : Never
3529 containers :
3630 - name : {{ $module.name }}
3731 image : {{ $module.image.registry }}/{{ $module.image.repository }}:{{ $module.image.tag }}
38- imagePullPolicy : {{ $module.image.pullPolicy }}
32+ imagePullPolicy : {{ default "Always" $module.image.pullPolicy }}
3933 {{- if $.Values.lifecycleHooks }}
40- lifecycle : {{- include "common.tpvalues .render" (dict "value" $.Values.lifecycleHooks "context" $) | nindent 12 }}
34+ lifecycle : {{- include "common.tplvalues .render" (dict "value" $.Values.lifecycleHooks "context" $) | nindent 12 }}
4135 {{- end }}
4236 {{- if $.Values.containerSecurityContext.enabled }}
4337 securityContext : {{- omit $.Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
4438 {{- end }}
4539 {{- if $.Values.command }}
46- command : {{- include "common.tplvalues.render" (dict "value" $.Values.command "context" $) | nindent 12 }}
40+ command : {{- include "common.tplvalues.render" (dict "value" $.Values.command "context" $ ) | nindent 12 }}
4741 {{- end }}
4842 {{- if $.Values.args }}
49- args : {{- include "common.tplvalues.render" (dict "value" $.Values.args "context" $) | nindent 12 }}
43+ args : {{- include "common.tplvalues.render" (dict "value" $.Values.args "context" $ ) | nindent 12 }}
5044 {{- end }}
45+
5146 env :
52- - name : container_user
53- value : " {{ $.Values.containerSecurityContext.runAsUser }}"
54- - name : JDK_JAVA_OPTIONS
55- value : " {{ $.Values.additionalResources.javaOpts }}"
56- - name : modules
57- value : " {{ $module.name }}"
47+ - name : container_user
48+ value : " {{ $.Values.containerSecurityContext.runAsUser }}"
49+ - name : JDK_JAVA_OPTIONS
50+ value : " {{ $.Values.additionalResources.javaOpts }}"
51+ - name : modules
52+ value : " {{ $module.name }}"
53+
5854 {{- if $.Values.extraEnvVars }}
59- {{- include "common.tpvalues .render" (dict "value" $.Values.extraEnvVars "context" $) | nindent 12 }}
55+ {{- include "common.tplvalues .render" ( dict "value" $.Values.extraEnvVars "context" $ ) | nindent 14 }}
6056 {{- end }}
6157
58+ {{- if $module.extraEnvVars }}
59+ {{- include "common.tplvalues.render" ( dict "value" $module.extraEnvVars "context" $ ) | nindent 14 }}
60+ {{- end }}
61+
62+ # ============================================================
63+ # ENV FROM: GLOBAL + MODULE-WISE CONFIGMAPS + SECRETS
64+ # ============================================================
6265 envFrom :
66+ # -----------------------------
67+ # Global ConfigMaps
68+ # -----------------------------
6369 {{- if $.Values.extraEnvVarsCM }}
64- {{- range $.Values.extraEnvVarsCM }}
65- - configMapRef :
66- name : {{ . }}
67- {{- end }}
68- {{- end }}
69- {{- if $.Values.extraEnvVarsSecret }}
70- {{- range $.Values.extraEnvVarsSecret }}
71- - secretRef :
72- name : {{ . }}
73- {{- end }}
74- {{- end }}
70+ {{- range $.Values.extraEnvVarsCM }}
71+ - configMapRef :
72+ name : {{ . }}
73+ {{- end }}
74+ {{- end }}
75+
76+ # -----------------------------
77+ # Global Secrets
78+ # -----------------------------
79+ {{- if $.Values.extraEnvVarsSecret }}
80+ {{- range $.Values.extraEnvVarsSecret }}
81+ - secretRef :
82+ name : {{ . }}
83+ {{- end }}
84+ {{- end }}
85+
86+ # -----------------------------
87+ # Module-wise ConfigMaps
88+ # -----------------------------
89+ {{- if $module.extraEnvVarsCM }}
90+ {{- range $module.extraEnvVarsCM }}
91+ - configMapRef :
92+ name : {{ . }}
93+ {{- end }}
94+ {{- end }}
95+
96+ # -----------------------------
97+ # Module-wise Secrets
98+ # -----------------------------
99+ {{- if $module.extraEnvVarsSecret }}
100+ {{- range $module.extraEnvVarsSecret }}
101+ - secretRef :
102+ name : {{ . }}
103+ {{- end }}
104+ {{- end }}
105+
75106 ports :
76- - name : spring-service
77- containerPort : {{ $.Values.springServicePort }}
107+ - name : spring-service
108+ containerPort : {{ $.Values.springServicePort }}
109+
78110 volumeMounts :
79111 {{- if $.Values.enable_insecure }}
80- - mountPath : /usr/local/openjdk-11/lib/security/cacerts
81- name : cacerts
82- subPath : cacerts
112+ - mountPath : /usr/local/openjdk-11/lib/security/cacerts
113+ name : cacerts
114+ subPath : cacerts
83115 {{- end }}
84116 {{- if $.Values.uitestrig.volumes }}
85- {{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
86- - name : {{ $volume_name }}
87- mountPath : {{ $volume_value.volumeMounts.mountPath }}
117+ {{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
118+ - name : {{ $volume_name }}
119+ mountPath : {{ $volume_value.volumeMounts.mountPath }}
88120 {{- end }}
89121 {{- end }}
122+
90123 volumes :
91124 {{- if $.Values.enable_insecure }}
92125 - name : cacerts
93126 emptyDir : {}
94127 {{- end }}
95128 {{- if $.Values.uitestrig.volumes }}
96- {{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
129+ {{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
97130 - name : {{ $volume_name }}
98131 configMap :
99132 defaultMode : {{ $volume_value.defaultMode }}
@@ -102,5 +135,3 @@ spec:
102135 {{- end }}
103136{{- end }}
104137{{- end }}
105-
106-
0 commit comments