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

OpenShift Projects and ProjectRequests not ordered appropriately with namespaces #2563

Closed
tylerauerbeck opened this issue Jun 3, 2020 · 7 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@tylerauerbeck
Copy link

When creating a kustomization that creates Projects/ProjectRequests, kustomize doesn't create these objects in the order that I'd expect. Since Projects/ProjectRequests are functionally namespaces, I would expect them to be created as some of the initial objects just as namespaces are. However it appears that kustomize treats them more like CustomResources and doesn't try to create them until the end of the list (which causes issues for any objects that need to be created in those projects.

Is there anyway (ideally in v2.0.3 which is bundled with oc and kubectl) to force this order?

@mpreu
Copy link

mpreu commented Jun 4, 2020

@tylerauerbeck
The simplest solution is to use the reorder option.

kustomize build --reorder none ...

Using that option you are on your own how to order objects. I use that in combination with OCP successfully, but currently in a 3.11 cluster. Therefore I cannot verify whether that option is included in the latest oc bundle. If that's not the case the internal ordering should be enforced and only k8s resources are considered.

Of course the fallback solution is to separate the project creation in a setup configuration which is executed on its own first in the chain.

@tylerauerbeck
Copy link
Author

Thanks @mpreu -- that's what I had thought the case was going to be, but would also like to hear from some of the folks on the kustomize end to see if they've got input as well.

I was hoping to be able to stick with features that are available in v2.0.3 just so that I would be able to run a single command oc apply -k ..., but looks like that may not be feasible at this point. I thought I saw some hack around making OpenShift specific objects look like CRD's (which I would assume might get them added toward the top of the list, but also don't know if that's a great approach either.

@mpreu
Copy link

mpreu commented Jun 5, 2020

@tylerauerbeck
Just to give some final notes as I tried something similar before reorder none was introduced.

You are maybe referring to something like this #97 and this https://github.com/adnovum/kustomize-openshift (supporting CRDs before transformer configurations offered an easier way).

When I am not missing something, this method is not allowing for "rewriting" the kind of a resource, so kind comparison is still happening to the hard-coded list. Even if that would be the case, since ordering happens on the processed configuration this would just emit an invalid resource definition in most cases. In the end more of an academic example. (Obviously some of the official guys could prove me wrong here).

Unfortunate to see that the CLIs are not integrating a more recent version kubernetes/kubectl#818.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 3, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 3, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants