Can init container be a kubernetes job

4/8/2019

Is it possible to have a kubernetes job as init container for my kubernetes pod?

I want to start my kubernetes pod/ deployment only after the kubernetes job has successfully reached completed state. If above is not possible, is there any other way out? I can not use an external script to check kubectl wait --for=condition=complete etc and then start my pod.

-- Ashish Vyas
kubernetes

1 Answer

4/8/2019

Yes, you can safely use the same pod spec in Init container, as you used before in Job object. If you need to implement more sophisticated workflows please take a look at Argo Workflow framework - for doing things done on Kubernetes. Here is an example of Conditionals usage.

-- Nepomucen
Source: StackOverflow