Scope reconciler to single namespace #2560
-
We have to migrate our infrastructure from one cluster to another one, where we can only use a single namespace. This is problematic for our CRDs, because they usually need cluster-level access. The installation can be done by the admins of the new cluster, but during runtime I need the operator to run in a single namespace without requesting or trying to watch resources from outside of its namespace. How can I achieve this within a kubebuilder-project? Are there any possibilities that I just haven't found out about until now? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @tim-hilt ! If you need deploy your operator in a single namespace and control that namespace, you can make next steps:
After that your You can check the documentation in here
Example:
You can check the documentation in here And you can check the kubebuilder documentation with example in here I hope that i help you! |
Beta Was this translation helpful? Give feedback.
-
HI @tim-hilt, By default, the projects are scaffolded with a cluster-scope. However, you could change that for namespaced-scope. The best doc to help you out with seems to leave in the SDK repo, see: https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/ Would be great if we have a tutorial in Kubebuilder docs about it and how to change the scope of your operator from cluster to namespaced one. Would you like to contribute with? If so, please feel free to push some PR. |
Beta Was this translation helpful? Give feedback.
-
Closing since it is answered. |
Beta Was this translation helpful? Give feedback.
HI @tim-hilt,
By default, the projects are scaffolded with a cluster-scope. However, you could change that for namespaced-scope. The best doc to help you out with seems to leave in the SDK repo, see: https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/
Would be great if we have a tutorial in Kubebuilder docs about it and how to change the scope of your operator from cluster to namespaced one. Would you like to contribute with? If so, please feel free to push some PR.