-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Do not add namespace to cluster-scoped CRD objects #552
Comments
This is an interesting problem. Kustomize does not currently talk to a Kubernetes cluster and has no facility to determine whether or not it is appropriate to add namespace to a custom resource object. I'm not sure how kustomize can decide this unless it sees the custom resource definition as part of the deployed manifests. If kustomize is unable to determine whether or not to omit namespace during manifest generation, then diffing tools like Argo CD will probably need add some special case logic for |
Good point - it hadn't occurred to me that kustomize can't look into a CRD's spec to determine its scope. Hopefully transformer configurations can be extended to support not adding a namespace to cluster-scoped resources. E.g. namespace:
- path: metadata/namespace
create: false
kind: ClusterIssuer |
Any update on this ? We are having the same problem with a cluster scoped CRD |
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. |
Stale issues rot after 30d 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. |
@mgoodness @primeroz @jessesuen Please have a look at:
|
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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. |
can someone reopen this issue? it is still relevant |
We just hit this issue. Any reason why it is not opened? |
Hi, any updates on this scenario? I am facing this with the custer-scoped CR with Kustomize and ArgoCD, being kustomize adding the namespaces to it, the ArgoCD is not ignoring the namespace on that but throwing an error. |
@sigwinch28: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
CRDs can be namespace- or cluster-scoped by setting
spec.scope
toNamespaced
orCluster
. If a CRD is cluster-scoped, kustomize should not addmetadata.namespace
to objects of that kind.Note that while there's no harm in adding
metadata.namespace
to a cluster-scoped CRD object (Kubernetes ignores it), it does show up as a "diff" in GitOps-style CD systems like Argo.The text was updated successfully, but these errors were encountered: