-
Notifications
You must be signed in to change notification settings - Fork 218
Support multiple versions of a CRD #94
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
Comments
@csviri Is this on the roadmap in the near future? |
This should actually work already, no? If not, could you explicit a scenario that doesn't work? |
@metacosm good question, went though again on the docs:
So IMHO, if nobody else sees it otherwise (@metacosm @stoetti @adam-sandor ? ) we are actually good on this. There is nothing to be done. I would even close the issue. |
I gave it a try without using the conversionStrategy 'None'. In that case k8s just changes the apiVersion to the version thats marked with stored=true. This obviously leads to a deserialization-error if there is an incompatible change in the CRD. I will work on a sample with a conversion webhook and see if there are any aspects that are worth building into a subproject. From the documentation the conversion-webhook is just a simple REST endpoint serving a specific interface. |
yes, just don't know how we would support that, probably does not make sense at all to do. Not sure how this is meant to be used, probably would be worth asking on kuberentes forums.
Sure, pls do, what I mean is since this is a mapping basically between json structures there is not much that can be done on a framework level to support this. Setting up such a service is already quite simple using just an application framework (spring, quarkus). |
From my perspective, different versions should be backed by different POJOs (though I understand there might be cases where that's not practical), each "registered" using a different version annotation so there shouldn't be a deserialization issue. Of course, if there is no backing object, there really is nothing the SDK can do… :) |
(Sorry this was an accident closing it) Maybe I don't understand this correctly, but the point of these conversion webhooks is to avoid to thinkin about multiple versions at the same time on client side. So having a conversion hook, basically makes it transparent for the client what version is actually used. |
Well, this would only work if your client can handle whatever the server returns, right? So even if you only want to keep one version to deal with on the client, there still needs to be a POJO on the client that's able to handle the converted version. |
So how I understand it correctly the default worflow looks like this:
This means there is no point where the Operator actually needs to handle 2 CR version at the same time. So the client have to handle only the version for which it asks for. This is good because in most cases there can be an easy migration happening. |
That's my understanding as well but the SDK has nothing to do in this scenario so this really isn't an issue, perhaps only something to document. |
Agree, |
This popped up again, consider a migration path from v1 to v2 of CR and related Reconciler:
In other words actually to support kinda canary testing within one operator with multiple controllers, so we would allow to have a separate controller for different version of CR. To be done from our side, would be just to remove the current check, and create an Integration test that showcases this approach. |
pls let me know what do you think @metacosm @adam-sandor @andreaTP |
I completely agree with this last statement @csviri . I do believe that the
The end user can than decide how to handle this situation, simply throwing an exception, logging, updating the status etc... |
@andreaTP @metacosm I think we also do this after v2, checked and would like then create an e2e test for it, that would require a conversion hook etc, so this is not just for few hours to do it in good quality. Since it's not an API change will do it after v2.0.0 released, and will be one of the issues in v2.1.0. |
A workaround for now is to implement both the controllers in the code base, put there a feature flag which one to register and deploy two instances of the operator, where the feature flag is the difference. |
(related docs in kubebuilder: https://book.kubebuilder.io/multiversion-tutorial/tutorial.html ) |
Within one CRD there could be multiple versions defined, we need to explicitly support this.
The text was updated successfully, but these errors were encountered: