-
Notifications
You must be signed in to change notification settings - Fork 72
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
Update Kustomize templates to 5.0.x #955
Comments
The problemI am still researching the best way to solve this given that vars are being deprecated and the kustomize project have not provided adequate solutions (e.g. discussions here and here) to allow replacing fields with namespaces from the top level kustomization of a multi-namespace kustomize deployment. The problem we are facing appears to reside here, where we define a set of vars When converting to replacements from vars here @burmanm attempted to manipulate the ValidatingWebhookConfiguration and CustomResourceDefinition to take the namespace/name of a Certificate, and add the namespace and name of a service to the DNS names of a Certificate. This replicates the vars functionality discussed above. (There is some more manipulation on CRDs as well, but leave that for now.) At present, having diff'd the output of the two kustomizations, I see a problem here (correct version on the left):
And another here:
Michael's analysis is that the replacements are occuring prior to the namespace transformer running. This is odd because the namespace transformer is in an overlay while the replacements reside in a component. As mentioned in this comment, the KEP for components states that:
And currently replacements within components do not seem to be adhering to that contract, as they are being run prior to the namespace transformer in the bases. Research so farI have a few preliminary suggestions/observations/directions for further research;
|
@burmanm I'm still trying to work through what the problem is here. I was drafting an issue for the kustomize project, but when I put together a minimal reproducible example (see here) I found that the following set up works;
Can you please test against that repo and see whether you get the expected result? The |
Michael and I discussed again, it looks like (while setting the namespace in an overlay works), setting the namespace in the top level kustomization (when it also includes the component) does not. For re-use in k8ssandra-operator, this will require us to copy across the namespacing replacements from cass-operator to k8ssandra-operator. It also suggests that kustomize has broken the components API for replacements, since components were meant to run after their parent overlays. I have raised an issue on the repo here, but will not work further on this at present, because it seems like a bug in kustomize. I also tried:
There are additional things I could try, but I think two days is enough to spend on this. My reasoning for putting it on hold is that;
|
@burmanm @Miles-Garnsey, if I understand correctly we're blocked here until Kustomize fixes some behaviors (if that ever happens)? |
There's a response on the issue I raised, I need to test their latest fix. |
@Miles-Garnsey This is the original ticket. |
@adejanovski So, here's a short description of the problem. We currently ship with only kustomize 4.x support in k8ssandra-operator, however if users want to use kubectl to install k8ssandra-operator they can only use kustomize 5.x and these are not compatible with each other in cases such as namespaces or component execution order. Last kubectl that supported kustomize 4.x was 1.26, which was EOLed in February 2024. Most users probably use 1.28 or 1.29 or something newer as that's what their package manager (such as brew) installs. If we stick to kustomize 4.x series, we'll be in a situation where we should mark use of kustomize as internal only and remove it from our docs as a method of installation. That means helm would be the only supported method of installation. There's also the 5.0.x and 5.4.x not being entirely compatible with each other, making kustomize an even bigger mess of course. |
Is Kustomize now in a state that allows us to upgrade without breaking our installations? I'd jump straight to the latest (5.4?), which could mean |
What is missing?
We use deprecated Kustomize template directives. We should update to 5.0.x compatible ones to prevent any deprecation warnings when deploying.
Why do we need it?
Environment
K8ssandra Operator version:
Insert image tag or Git SHA here
Anything else we need to know?:
The text was updated successfully, but these errors were encountered: