mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-21 20:51:27 +00:00
deploy(apollo-rhworker): add preCommand and postCommand values for cronjobs (#3)
* 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 * feat: automatically terminate cronjob after 5 minutes
This commit is contained in:
parent
0d51fdb161
commit
656f7b5a4f
@ -15,7 +15,7 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.1
|
version: 0.1.2
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
|
@ -19,6 +19,7 @@ spec:
|
|||||||
serviceAccountName: {{ include "apollo-rhworker.serviceAccountName" . }}
|
serviceAccountName: {{ include "apollo-rhworker.serviceAccountName" . }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.podSecurityContext | indent 8 }}
|
{{- toYaml .Values.podSecurityContext | indent 8 }}
|
||||||
|
activeDeadlineSeconds: 300
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}-poll-rh-advisories-workflow
|
- name: {{ .Chart.Name }}-poll-rh-advisories-workflow
|
||||||
image: temporalio/admin-tools:1.10.5
|
image: temporalio/admin-tools:1.10.5
|
||||||
@ -30,9 +31,11 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command: ["/bin/bash", "-c"]
|
command: ["/bin/bash", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
{{- range $cmd := $.Values.cron.preCommand }}
|
||||||
trap 'curl --max-time 2 -s -f -XPOST http://127.0.0.1:15020/quitquitquit' EXIT
|
- {{ $cmd }}
|
||||||
while ! curl -s -f http://127.0.0.1:15020/healthz/ready; do sleep 1; done
|
{{- end }}
|
||||||
echo "Ready!"
|
- tctl wf run --tq v2-rhworker --wt PollRHAdvisoriesWorkflow
|
||||||
tctl wf run --tq v2-rhworker --wt PollRHAdvisoriesWorkflow
|
{{- range $cmd := $.Values.cron.postCommand }}
|
||||||
|
- {{ $cmd }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -83,6 +83,12 @@ autoscaling:
|
|||||||
cron:
|
cron:
|
||||||
enabled: true
|
enabled: true
|
||||||
schedule: "*/15 * * * *"
|
schedule: "*/15 * * * *"
|
||||||
|
preCommand:
|
||||||
|
- trap 'curl --max-time 2 -s -f -XPOST http://127.0.0.1:15020/quitquitquit' EXIT
|
||||||
|
- while ! curl -s -f http://127.0.0.1:15020/healthz/ready; do sleep 1; done
|
||||||
|
- echo "Ready!"
|
||||||
|
postCommand:
|
||||||
|
- echo "Complete!"
|
||||||
|
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user