DEV Community

Discussion on: Database (Schema) migration to Kubernetes - initContainers vs k8s jobs -

Collapse
 
tareksamni profile image
Tarek N. Elsamni • Edited

You can even run the job as part of your helm chart. Then you can set the job as a pre hook in helm which will make sure to run the job before anything else and only go forward with deployment when the job succeeds.

NB: remember to create any secrets, configmaps and etc (using a pre hook with less value than the job). that the job will need before running the job itself.

Collapse
 
ahmeddrawy profile image
Ahmed Hanafy

yes I found this solution too, but we prefered to invoke the job from the CI pipelines instead