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

Add templating support #236

Open
mrueg opened this issue Feb 11, 2022 · 5 comments
Open

Add templating support #236

mrueg opened this issue Feb 11, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@mrueg
Copy link
Contributor

mrueg commented Feb 11, 2022

It would be awesome if we could have a user supplied template for constraints and constrainttemplate.

Mainly this would provide the ability to add custom labels and annotations (which could be added here as well) but probably other settings and variables could be transferred as well.

@jpreese
Copy link
Collaborator

jpreese commented Feb 11, 2022

I think the ability to add labels and annotations make sense. Is this your immediate use case? Is there anything else you're wanting to be able to alter in the constraints and templates?

@jpreese jpreese added the enhancement New feature or request label Feb 11, 2022
@mrueg
Copy link
Contributor Author

mrueg commented Feb 11, 2022

Ideally, support for a static template so I could render the result and use a helm template (so labels and annotations is a first step, but there might be additional fields that others would want exposed or some yaml preprocessing)

@jalseth
Copy link
Collaborator

jalseth commented Feb 13, 2022

I think we could add support for @label and @annotation tags in the header if desired, but if the desire is for a general ability to modify all K8s metadata for the Constraint/ConstraintTemplate then I don't think Konstraint is the tool for that. That sounds like it would be better suited for Kustomize which can patch the resources generated by Konstraint to insert labels, annotations, and any other changes.

@mrueg
Copy link
Contributor Author

mrueg commented Feb 13, 2022

I think labels and annotations are a great thing to start with, agreed kustomize is a good solution as well!

@rossedman
Copy link

Chiming in here, there are some use cases where adding full template support would be preferred over just annotations and labels. Most of this revolves around Gatekeeper's unique way of creating CRDs and how that effects systems that automatically roll out and apply these resources. Example here

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

No branches or pull requests

4 participants