-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
CRDGenerator: Allow to configure conversion webhooks #5794
Comments
PoC: baloo42#3 |
You might want to checkout this repo too: cc. @csviri |
I already used JOSDK-webhooks as well as JOSDK, QOSDK and of course fabric8/kubernetes-client in a few real world projects. And I love it ;) There are only some small things missing which I would like to contribute in the near future. To name a few planned improvements:
|
Hi @baloo42
feel free to create issues for those and pls describe the enhancement for the current approach. Note that currently we are working on v5, so we can make some breaking changes.
That would be more than welcome, unfortunately, we have limited time, basically spring boot starter is now in maintenance mode. |
Nice! 🎉 And many thanks for engaging with us and contributing back, much appreciated!
Is it Open Source? If not, would you share details of its design? I'm interested and probably also @shawkins
FYI this exists: https://github.com/projectnessie/cel-java
This is completely out of curiosity for me, any specific reason why you prefer code first as opposed to contract first? |
I will do before I start, thanks for the hint. We don't need those changes in the near future, so it makes sense to me contribute directly to v5. In short: We have produced a lot of NPEs in the past because status, status conditions and events must be passed through sometimes. I'm looking for a base implementation to avoid those often made mistakes.
We noticed that too. We started with the starter but had to switch to our own base. Maybe I can help here to add some missing features, make it easier to maintain and if you wish i can also help you with maintenance. Started a discussion in operator-framework/josdk-spring-boot-starter#142
Unfortunatly it's not open source. But my customer has an Open Source program and they might discuss this in the future. Until that, we can discuss some general design decisions. Can you suggest a place for it?
Let's discuss it! --> #5851
Good question 😃 It's often not my decision alone and I used both approaches in the past. I also think it heavily depends on the team and on the use case. But if I have the choice and if it fits to the use case, I prefer the code-first strategy. |
Probably, the best place to have this discussion in public is here: https://github.com/keycloak/keycloak/discussions And thanks for the feedback on the rest of the subjects! |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
I'm using the JOSDK framework as well, and it's useful for creating the conversion webhooks. But they still need to be configured in the CRD. So I'm also intereseted in this proposal, because currently I can't configure the webhook for the CRD. |
Updated the description with the outcome of my experiments so far. Most of it is straight forward, but how should we deal with the more "dynamic" parts of the configuration? The service namespace, service name and the caBundle attribute are often overridden when deployed to a specific environment. conversion:
strategy: Webhook
webhook:
conversionReviewVersions: ["v1","v1beta1"]
clientConfig:
service:
namespace: default
name: example-conversion-webhook-server
path: /crdconvert
caBundle: "Ci0tLS0tQk...<base64-encoded PEM bundle>...tLS0K" Should we make e.g. the caBundle configurable via the annotation? Or would it be better to restrict configuration via annotation to only the meaningful parts and instead allow the user to inject a value by CLI, Maven, Gradle parameters? Another approach would be to provide an utility method (API)/ subcommand (CLI)/ mojo (maven plugin) to patch existing CRDs with a conversion strategy. For example a @BramMeerten Do you have an opinion on that topic? |
Is your enhancement related to a problem? Please describe
At the moment there is no easy way to configure conversion webhooks for the generated CRDs:
https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#configure-customresourcedefinition-to-use-conversion-webhooks
Describe the solution you'd like
A solution could be to create one or more additional annotations which allows a user to configure the webhook:
Annotation
@WebhookConversion
:Annotation
@NoneConversion
:Describe alternatives you've considered
No response
Additional context
See also: #4692
Example Approval tests:
https://github.com/baloo42/crd-generator-victools/blob/main/test/src/test/java/io/fabric8/crd/generator/victools/approvaltests/conversion/NoneConversionExample.java
https://github.com/baloo42/crd-generator-victools/blob/main/test/src/test/resources/io/fabric8/crd/generator/victools/approvaltests/CRDGeneratorVictoolsApprovalTest.approvalTest.noneconversions.samples.fabric8.io.v1.approved.yml
https://github.com/baloo42/crd-generator-victools/blob/main/test/src/test/java/io/fabric8/crd/generator/victools/approvaltests/conversion/v2/WebhookConversionExample.java
https://github.com/baloo42/crd-generator-victools/blob/main/test/src/test/resources/io/fabric8/crd/generator/victools/approvaltests/CRDGeneratorVictoolsApprovalTest.approvalTest.webhookconversions.samples.fabric8.io.v1.approved.yml
The text was updated successfully, but these errors were encountered: