Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 73 additions & 42 deletions helm/uitestrig/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,84 +16,117 @@ metadata:
{{- end }}
spec:
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1 # remove jobs which are successfully executed
failedJobsHistoryLimit: 1 # except 1 recent failed job, remove jobs which are not successfully executed
#schedule: '*/3 * * * *' # cron spec of time
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
schedule: {{ $.Values.crontime }}
jobTemplate:
spec:
backoffLimit: 0 # this has very low chance of failing, as all this does
# is prompt kubernetes to schedule new replica set for
# the deployment
# activeDeadlineSeconds: 600 # timeout, makes most sense with
# "waiting for rollout" variant specified below
backoffLimit: 0
template:
spec:
# account configured above
serviceAccountName: {{ template "uitestrig.serviceAccountName" $ }}
restartPolicy: Never
containers:
- name: {{ $module.name }}
image: {{ $module.image.registry }}/{{ $module.image.repository }}:{{ $module.image.tag }}
imagePullPolicy: {{ $module.image.pullPolicy }}
imagePullPolicy: {{ default "Always" $module.image.pullPolicy }}
{{- if $.Values.lifecycleHooks }}
lifecycle: {{- include "common.tpvalues.render" (dict "value" $.Values.lifecycleHooks "context" $) | nindent 12 }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" $.Values.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if $.Values.containerSecurityContext.enabled }}
securityContext: {{- omit $.Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if $.Values.command }}
command: {{- include "common.tplvalues.render" (dict "value" $.Values.command "context" $) | nindent 12 }}
command: {{- include "common.tplvalues.render" (dict "value" $.Values.command "context" $ ) | nindent 12 }}
{{- end }}
{{- if $.Values.args }}
args: {{- include "common.tplvalues.render" (dict "value" $.Values.args "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" $.Values.args "context" $ ) | nindent 12 }}
{{- end }}

env:
- name: container_user
value: "{{ $.Values.containerSecurityContext.runAsUser }}"
- name: JDK_JAVA_OPTIONS
value: "{{ $.Values.additionalResources.javaOpts }}"
- name: modules
value: "{{ $module.name }}"
- name: container_user
value: "{{ $.Values.containerSecurityContext.runAsUser }}"
- name: JDK_JAVA_OPTIONS
value: "{{ $.Values.additionalResources.javaOpts }}"
- name: modules
value: "{{ $module.name }}"

{{- if $.Values.extraEnvVars }}
{{- include "common.tpvalues.render" (dict "value" $.Values.extraEnvVars "context" $) | nindent 12 }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.extraEnvVars "context" $ ) | nindent 14 }}
{{- end }}

{{- if $module.extraEnvVars }}
{{- include "common.tplvalues.render" ( dict "value" $module.extraEnvVars "context" $ ) | nindent 14 }}
{{- end }}

# ============================================================
# ENV FROM: GLOBAL + MODULE-WISE CONFIGMAPS + SECRETS
# ============================================================
envFrom:
# -----------------------------
# Global ConfigMaps
# -----------------------------
{{- if $.Values.extraEnvVarsCM }}
{{- range $.Values.extraEnvVarsCM }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- if $.Values.extraEnvVarsSecret }}
{{- range $.Values.extraEnvVarsSecret }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- range $.Values.extraEnvVarsCM }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- end }}

# -----------------------------
# Global Secrets
# -----------------------------
{{- if $.Values.extraEnvVarsSecret }}
{{- range $.Values.extraEnvVarsSecret }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}

# -----------------------------
# Module-wise ConfigMaps
# -----------------------------
{{- if $module.extraEnvVarsCM }}
{{- range $module.extraEnvVarsCM }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- end }}

# -----------------------------
# Module-wise Secrets
# -----------------------------
{{- if $module.extraEnvVarsSecret }}
{{- range $module.extraEnvVarsSecret }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}

ports:
- name: spring-service
containerPort: {{ $.Values.springServicePort }}
- name: spring-service
containerPort: {{ $.Values.springServicePort }}

volumeMounts:
{{- if $.Values.enable_insecure }}
- mountPath: /usr/local/openjdk-11/lib/security/cacerts
name: cacerts
subPath: cacerts
- mountPath: /usr/local/openjdk-11/lib/security/cacerts
name: cacerts
subPath: cacerts
{{- end }}
{{- if $.Values.uitestrig.volumes }}
{{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
- name: {{ $volume_name }}
mountPath: {{ $volume_value.volumeMounts.mountPath }}
{{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
- name: {{ $volume_name }}
mountPath: {{ $volume_value.volumeMounts.mountPath }}
{{- end }}
{{- end }}

volumes:
{{- if $.Values.enable_insecure }}
- name: cacerts
emptyDir: {}
{{- end }}
{{- if $.Values.uitestrig.volumes }}
{{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
{{- range $volume_name, $volume_value := $.Values.uitestrig.volumes.configmaps }}
- name: {{ $volume_name }}
configMap:
defaultMode: {{ $volume_value.defaultMode }}
Expand All @@ -102,5 +135,3 @@ spec:
{{- end }}
{{- end }}
{{- end }}