Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating a kubernetes job: what happens?

Tags:

kubernetes

I'm looking for a definitive answer for k8s' response to a job being updated - specifically, if I update the container spec (image / args).

If the containers are starting up, will it stop & restart them?

If the job's pod is all running, will it stop & restart?

If it's Completed, will it run it again with the new setup?

If it failed, will it run it again with the new setup?

I've not been able to find documentation on this point, but if there is some I'd be very happy to get some signposting.

like image 931
Kieren Johnstone Avatar asked Nov 16 '25 11:11

Kieren Johnstone


1 Answers

The .spec.template field can not be updated in a Job, the field is immutable. The Job would need to be deleted and recreated which covers all of your questions.

The reasoning behind the changes aren't available in the github commit or pr, but these changes were soon after Jobs were originally added. Your stated questions are likely part of that reasoning as making it immutable removes ambiguity.

like image 140
Matt Avatar answered Nov 18 '25 19:11

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!