Skip to content

How can I deploy/sync a Job resource with Argo CD? #7984

Answered by jannfis
wolframkleis asked this question in Q&A
Discussion options

You must be logged in to vote

Hm. I'd dare to say that Kubernetes Jobs are classical one time events. You deploy a Job into your cluster, it will run and afterwards be terminated - it can't be re-run. Probably due to this fact, lots of fields in the Job spec are immutable and can't be changed once the resource exists in your cluster. Also, this makes it a quite ungrateful resource for being managed in a GitOps way.

I'd suggest to make your Job a sync hook, with a proper deletion policy (e.g. BeforeHookCreation), so that the Job will be deleted and re-created on every sync. If you have no other resources for your application that could sync, maybe you can just create a ConfigMap (with a timestamp or similar property) f…

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@tooptoop4
Comment options

@neiser
Comment options

@milank78git
Comment options

@neiser
Comment options

Answer selected by todaywasawesome
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@N214
Comment options

@andrii-korotkov-verkada
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants