distro-tools/deploy/apollo/apollo-rhworker/templates/cronjob.yaml
Neil Hanlon 7cf09716e4
deploy(apollo-rhworker): add preCommand and postCommand values for cronjobs
We don't want to assume a user will be running this with Istio as the
RESF is, so we don't always need to kill the istio proxy in this manner

This change moves the existing trap/curl command to terminate the istio
proxy into values.yaml for our deployment allowing it to be overwritten
for others needs
2023-04-06 15:39:23 -04:00

41 lines
1.4 KiB
YAML

{{- if .Values.cron.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "apollo-rhworker.fullname" . }}
labels:
{{- include "apollo-rhworker.labels" . | nindent 4 }}
spec:
schedule: '{{ .Values.cron.schedule }}'
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "apollo-rhworker.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | indent 8 }}
containers:
- name: {{ .Chart.Name }}-poll-rh-advisories-workflow
image: temporalio/admin-tools:1.10.5
securityContext:
{{- toYaml .Values.securityContext | indent 12 }}
env:
- name: TEMPORAL_CLI_ADDRESS
value: workflow-temporal-frontend.workflow.svc.cluster.local:7233
imagePullPolicy: IfNotPresent
command: ["/bin/bash", "-c"]
args:
{{- range $cmd := $.Values.cron.preCommand }}
- {{ $cmd }}
{{- end }}
- tctl wf run --tq v2-rhworker --wt PollRHAdvisoriesWorkflow
{{- range $cmd := $.Values.cron.postCommand }}
- {{ $cmd }}
{{- end }}
{{- end }}