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

Kubernetes Extension: Allow templating of additional kubernetes resources #45779

Open
andreas-eberle opened this issue Jan 22, 2025 · 4 comments
Labels

Comments

@andreas-eberle
Copy link
Contributor

Description

The Quarkus Kubernetes extension allows to provide custom resources to be installed alongside Quarkus via the resources/kubernetes directory (see https://quarkus.io/guides/deploying-to-kubernetes#using-existing-resources).

Unfortunately, it seems these resources cannot be templated / modified. In projects, we usually have different configurations per stage. In this case, we want to provide a CRD for a database operator and thus we want to configure it to use a larger storage in production than in the dev stage. For this, it would be great if we could use a variable syntax like ${my.field.from.application.properties} or something like that to inject fields from the application.properties into the provided kubernetes resource.

Implementation ideas

Allow using template syntax e.g. like Qute templates {my.field.from.application.properties} or something like ${my.field.from.application.properties} in the provided kubernetes resources and replace the variables with values from the application.properties.

@andreas-eberle andreas-eberle added the kind/enhancement New feature or request label Jan 22, 2025
Copy link

quarkus-bot bot commented Jan 22, 2025

/cc @geoand (kubernetes), @iocanel (kubernetes)

@geoand
Copy link
Contributor

geoand commented Jan 22, 2025

Sounds like an interesting enhancement!

Would you like to work on this?

@andreas-eberle
Copy link
Contributor Author

I'm unsure if I can find the time to dive into this. But could you give me (or anyone else interested) a couple of hints. E.g.

  • I quickly tried to figure out where exactly these resources are read and combined with the rest but didn't find it.
  • And what way would you recommend to use to template the stuff? Should we use Qute? Or is there a standard mechanism to use the same variable templating like we have in the application.properties?

@geoand
Copy link
Contributor

geoand commented Jan 23, 2025

It might be that the files need to be templated in Dekorate (which Quarkus uses for the Kubernetes manifest generation). @iocanel do you remember?

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

No branches or pull requests

2 participants