-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
kustomize re-orders config causing fail when crd or admission webhook used #821
Comments
possible solutions?
others? |
In the short term I have a workaround:
|
kustomize already sorts things like namespaces for this reason. CRDs and Webhooks should also be sorted IMHO. |
I think we just need to add MutatingWebhooks here: Line 73 in 92fc368
|
This issue is not resolved by that commit. |
Re-opened. kubernetes/enhancements#865 proposed as a general solution to order. Open to other ideas. @donbowman You mention that the PR that attempted to close this issue did not include the data you provided, and it did not. But the test case you mention was a large tarball of resources - which can be a lot to digest. The readme suggests a good approach for reporting undesired output, but i realize that it's buried in a bunch of commentary. basically, if you convert your data to a unit test in the
please consider converting your data to such a test. It's not that i don't understand the problem, it's that i want help with regression coverage. |
Fwiw, I suggest replacing #822 with something that orders Webhook declarations last. In a single invocation (and without more human-driven direction), we have to assume that we aren't able to perform the webhook until after Deployments/etc have started, and we also have to assume that other resources in the same invocation don't require the (mutating) webhook to act on them (that would be a bootstrapping cycle). (Edit: or better yet for kustomize: preserve original document order) |
Fixes the cert-manager example of kubernetes-sigs#821.
Fixes the cert-manager example of kubernetes-sigs#821.
I changed the order so that However unnecessary problems caused by ordering may still appear in theory when using objects with a The question is: why was a kustomize-specific order introduced in the first place? Edit: Also I didn't touch the |
I strongly agree with this. Baking in dependency re-ordering requires understanding all types. |
What was the downside to leaving ordering up to the user, based on the order of the manifest appeared in the kustomization.yaml resources array? What motivated explicit ordering in |
I guess one of the reasons was to make it more declarative/deterministic (but I don't know - one of the original authors should answer this - @monopole?). Is there already tooling that features the kind of deployment described above (waiting for apiservice/deployment to become available before applying another yaml/package)? (I don't mean helm + shell scripts) |
To just carry on forward with what @brichins had suggested, can |
that is not a good configuration, and creation order is not a reasonable way to mitigate that. see the |
@liggitt thanks for the info. |
Modify all test coverage to compare actual build output against a non-sorted version of expected output. Expected output is specified in the same order as the inputs are specified in the kustomization file, using a depth-first ordering when overlays are involved. Fixes kubernetes-sigs#756 Related kubernetes-sigs#821
Modify all test coverage to compare actual build output against a non-sorted version of expected output. Expected output is specified in the same order as the inputs are specified in the kustomization file, using a depth-first ordering when overlays are involved. Fixes kubernetes-sigs#756 Related kubernetes-sigs#821
Modify all `build` tests to use the raw, non-sorted output of build. This makes every test provide coverage for how kustomize re-orders (or doesn't reorder) resources during processing. Going forward, the ordering of resources in _expected_ output should match the depth-first ordering specified in the `resources:` field used in the test's kustomization file. The only exception to this rule would be tests that actually confirmed some other output ordering, e.g. the test of the `LegacyOrderTransformer` plugin. Fixes kubernetes-sigs#756 Related kubernetes-sigs#821
Modify all `build` tests to use the raw, non-sorted output of build. This makes every test provide coverage for how kustomize re-orders (or doesn't reorder) resources during processing. Going forward, the ordering of resources in _expected_ output should match the depth-first ordering specified in the `resources:` field used in the test's kustomization file. The only exception to this rule would be tests that actually confirmed some other output ordering, e.g. the test of the `LegacyOrderTransformer` plugin. Fixes kubernetes-sigs#756 Related kubernetes-sigs#821
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
What if anything needs to be done here?
background
That said, kubernetes is built on the notion of controllers being told to So, the API server, given an The cases where it appears to do so, e.g. namespace creation, are outliers. |
More comments in #3794 |
If we look @ cert-manager we see that it has in its output:
thus the order must be preserved.
So if I apply
kustomize
across their input and addto the 'end', i get a failure
the attached output file shows. The
selfsigning-issuer
ClusterIssuer
is emitted in the middle, before its webhook is definedcert-manager-to-be-applied.yaml.gz
The text was updated successfully, but these errors were encountered: