-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oneshot jobs #49
Comments
I see this as a job for helm hooks as either a pre-upgrade or a post-upgrade hook. The chart that needs the job to run should be the one running the job. |
@sstarcher Interesting! Hooks didn't work for me as, for example, I do run a DB migration separately from a deployment of regular app to avoid down time. I'd use a hook if the job being run via it is composed of just small, short-running, safe tasks. Not for scheduling a large, long-running batch job paired with the regular server app. |
ya, it won't work if your application does not understand both database versions to allow for live migrations, but the hook is certainly the preferable mechanism as long as development puts in the time to allow the application to be cleanly upgraded. |
@sstarcher A change is almost always backward-compatible but it is just that my migration takes a table lock too long due to the size of table :) I fully agree that hooks are good for dev purpose. Transparent automatic db migration would indeed be valuable for dev envs! My use-case seems to be more about prod envs. |
I don't know enough about your situation, but I'm still not sure why you would not wait until you wanted to do the db migration to upgrade the helm chart. That way the migration got kicked off at the appropriate time. |
@sstarcher Probably you're suggesting the same thing as I do? I wasn't sure what would be a solution to my problem at the time of writing this issue But maybe I'd be happy with something like |
Or maybe |
@sstarcher Thanks. Opened #50 |
I'll be closing this once I add a small example about it to README. |
I'm a bit hesitant to propose this but how about supporting oneshot jobs in helmfile?
An oneshot job can be either a K8S job or a pod created via
helm upgrade --install
to accomplish a job like db migration, enqueueing a large job to a kind of workflow system, etc.As of today, we have to resort a variant of
kubectl run --image $img
to run an oneshot job, even in a situation that our regular app are managed by helm and shared the image, envvars with oneshot jobs.AFAIK, there's no such tool to support this use-case. And supporting it in helmfile allows us to provide a more docker-compose-like U/X to helm users, but the docker-build feature.
Thoughts?
cc/ @roboll @sstarcher
The text was updated successfully, but these errors were encountered: