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

Create more complete example of using grate in a container (k8s, etc) #117

Open
erikbra opened this issue Oct 21, 2021 · 9 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@erikbra
Copy link
Owner

erikbra commented Oct 21, 2021

How could one use grate in a Kubernetes setting?

  • Init container?
  • etc

Maybe @wokket s examples are enough. Verify 😄

@erikbra erikbra added the documentation Improvements or additions to documentation label Oct 21, 2021
@wokket
Copy link
Collaborator

wokket commented Oct 23, 2021

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 kubectl run --restart=never an image built like the samples...

@DjKillerMemeStar
Copy link
Contributor

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?

@erikbra
Copy link
Owner Author

erikbra commented Jun 11, 2022

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?

@DjKillerMemeStar
Copy link
Contributor

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 😄.

@wokket
Copy link
Collaborator

wokket commented Jun 11, 2022

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 kubectl run a one-off instance from the pipeline.

@DjKillerMemeStar
Copy link
Contributor

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.

@erikbra
Copy link
Owner Author

erikbra commented Jun 16, 2022

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?

@wokket
Copy link
Collaborator

wokket commented Jun 16, 2022

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

  • init containers (which I have no experience with), or
  • referencing grate via nuget (which I think RH had support for?? I never used it) and running a migration on app start?

@grrttedwards
Copy link
Contributor

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

No branches or pull requests

4 participants