Skip to content
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

Use init container for database migration #3

Open
andrenarchy opened this issue May 20, 2019 · 2 comments
Open

Use init container for database migration #3

andrenarchy opened this issue May 20, 2019 · 2 comments

Comments

@andrenarchy
Copy link
Contributor

Currently, migrations are run as a job in the Stellar Horizon chart, see

args: ["horizon", "db", "migrate", "up"]
. It might make sense to also use an init container for this, see #1 and #2.

@todkap Do you think an init container or a job is better suited for this?

@todkap
Copy link

todkap commented May 20, 2019

I think init container makes the most sense here.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#what-can-init-containers-be-used-for

There are benefits where the init container will restart if failed as well as block the starting of the app container until the migration is complete.

I agree with this article https://medium.com/@pliutau/database-migrations-with-go-and-kubernetes-2831d43a8f9c

@andrenarchy
Copy link
Contributor Author

Great, I also had the feeling that this is better. I think it should be configurable but enabling migrations by default is probably what most people would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants