[Feature Request] Allow Schema Job ttlSecondsAfterFinished to be configurable
Is your feature request related to a problem? Please describe.
Currently the ttlSecondsAfterFinished spec is hard coded to 86400. It would be ideal if not only you could change this value, but you could remove it altogether.
This is especially important if you use Argo for deployment. Eventually the after-finished controller kicks in and then the job disappears. Argo then reports that there is something missing in that particular application until its synced again.
Describe the solution you'd like
This should be easily achievable by adding some key value pairs in the values file and key off of those in the job template.
values.yaml:
schema:
garbageCollection:
# Enable or disable the job garbage collection
enabled: true
# Time before the job is removed in seconds Default 86400
ttlSeconds: 86400
templates/server-job.yaml existing:
spec:
backoffLimit: {{ $.Values.schema.setup.backoffLimit }}
ttlSecondsAfterFinished: 86400
updated:
spec:
backoffLimit: {{ $.Values.schema.setup.backoffLimit }}
{{- if and $.Values.schema.garbageCollection $.Values.schema.garbageCollection.enabled }}
ttlSecondsAfterFinished: {{ $.Values.schema.garbageCollection.ttlSeconds | default 86400 }}
{{- end }}
Bump this. Do you want me to create a PR?
Bumping again. Could really use this.
@PurseChicken talking about managing temporal using ArgoCD and this job, aren't you running into issues while updating the Helm chart? I am facing inmutable fields regarding the job which is quite normal but I was wondering how do you manage updates
@danifuuu Yes. When updating the chart, you just need to delete the job resource before syncing and then everything is fine.
@danifuuu Yes. When updating the chart, you just need to delete the job resource before syncing and then everything is fine.
but manually? seems a bit meh
@danifuuu Yes. When updating the chart, you just need to delete the job resource before syncing and then everything is fine.
but manually? seems a bit meh
I agree. You can also use sync options which would help in this situation as well.. but its more of a workaround:
Currently, the workaround is either to always recreate the resource (Replace=true,Force=true), or let the resource fail once (Replace=true) and manually perform a selective sync on that resource to perform a recreate (Replace=true,Force=true).
Ideally though this functionality gets moved out of a job, or make the job a sync hook, with a proper deletion policy.
There is now a PR which addresses this Issue.
Hey @PurseChicken! Do you plan to set it to some very low value so your job is removed almost right away after it finishes? If so having autosync in argo will keep recreating you this job if I'm not mistaken (that would be my case). With change from that MR: https://github.com/temporalio/helm-charts/pull/665 we could just add argo hook annotation so it's removed after it completes.
@k-ikigai No, I plan on disabling it completely. This is to avoid Argo saying that the application is out of sync due to the Job resource being removed. I personally rarely use Auto sync on applications anyway