-
Notifications
You must be signed in to change notification settings - Fork 39
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
Create more complete example of using grate in a container (k8s, etc) #117
Comments
You're on your own here mate, I have no desire to play in the k8s space for this stuff... we run live migrations in k8s, but literally just |
I have a tiny bit of experience with Service Fabric and i know we have hosted python containers in there. I could have a look how we do it for that and maybe create an exampld based on that? |
Thanks a lot, @DjKillerMemeStar ! I'd appreciate that. I don't think the main issue is hosting grate in a container, though, but how you should/would actually use it in a Kubernetes setting. Would you create an init container? Would you create a background service that watches a folder for changes? Something totally different? Do you have any thoughts on this? Maybe the question is too generic, and the use cases will vary a lot depending on each and every one's surrounding bits and bobs? |
I don't really see a point in hosting grate yourself. It's just install on the build server any way you like and run it. This seems like a way easier way to do it. Ofcourse, people/situations differ so i'm not sure. Maybe the question could be rephrased to beter explain what you mean. It's more of a "why would you use grate in a container" then a how in my eyes. Could ofcourse be wrong here 😄. |
I had a project where the build server (AzDo) didn't have access to the Sql Server (firewalled/PrivateLink/something weird???) but the k8s cluster obviously did have access. As noted above, we'd build the container like the sample and just |
Ow yeah, makes sense, sorry bout that! We just use our own agents so bypass any firewall restrictions etc, but that is ofcourse not possible for everyone. From that standpoint i don't see anything wrong with your approach of an one-off instance. |
I'm just thinking a bit further on this one. It might seem like I'm trying hard to create a use case for something that isn't, but, if you compare to, say EF migrations, where the migration is performed on application startup, would it make sense to create an example where grate is used in an init container, mounting the database scripts in a volume there, and running them on startup, before the actual application container starts? Or am I beating a dead horse here? |
I can see the comparison with EF Migrations (which fwiw I don't like for various reasons, hence being here). A sample for a migration style workflow would obviously be useful if that's a workflow you want to push, via either
|
There is the init container pattern described here: https://andrewlock.net/deploying-asp-net-core-applications-to-kubernetes-part-7-running-database-migrations/#combining-jobs-and-init-containers-to-handle-migrations |
How could one use grate in a Kubernetes setting?
Maybe @wokket s examples are enough. Verify 😄
The text was updated successfully, but these errors were encountered: