-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: support multi-namespace operator deployments #125
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
refactor: support multi-namespace operator deployments #125
Conversation
|
Test with the policies in #126, the result is as expected. |
b354716 to
c59d55e
Compare
|
@yalzhang one question, why the cluster role needs to be independent? I do understand that one change affects the entire cluster. However, it is similar for the TrustedExecutionCluster. Do we want to run test completely independent one from another? Theoretically, we do a single installation with the same RBAC and then run the tests |
My understanding is that this operator is intended to support multiple instances running in different namespaces, correct?
Because the ClusterRoleBinding name is reused, the binding for namespace A is overwritten, causing the operator instance in namespace A to break (for example, the register-server pod fails to start). Another approach would be to modify the existing ClusterRoleBinding when deploying a second instance and append additional subjects, like: However, this approach is more complicated to manage and maintain. |
c59d55e to
5853e51
Compare
|
I see, thanks for the explanation, makes totally sense |
| requiredDropCapabilities: | ||
| - KILL | ||
| - MKNOD | ||
| - SETUID | ||
| - SETGID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to be like below to make it minimum:
requiredDropCapabilities:
- ALL
|
@yalzhang have you tried if |
Restructure RBAC to allow installing the operator in multiple namespaces
simultaneously without conflicts.
- Move RBAC to standard Kustomize base/overlays structure
- Base resources in config/rbac/base/
- Platform overlays in config/rbac/overlays/{kind,openshift}
- Add namespace prefix to cluster-scoped bindings to prevent conflicts
- ClusterRoleBindings: {namespace}-manager-rolebinding, {namespace}-metrics-auth-rolebinding
- OpenShift SCC: {namespace}-trusted-cluster-scc
- Add PLATFORM variable (kind/openshift) to Makefile
- Consolidate kubebuilder RBAC markers in api/v1alpha1/crds.go
This enables running multiple operator instances (e.g., in "demo" and
"production" namespaces) without resource conflicts.
Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
5853e51 to
6175a34
Compare
|
@yalzhang: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Yes, for openshift, one more step 'export PLATFORM=openshift' before run 'make manifests' |
|
Tested on openshift cluster with 2 namespaces, and on kind cluster, VMs can boot successfully. And run integration test locally pass. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alicefr, yalzhang The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
da9a383
into
trusted-execution-clusters:main
Restructure RBAC to allow installing the operator in multiple namespaces simultaneously without conflicts.
Move RBAC to standard Kustomize base/overlays structure
Add namespace prefix to cluster-scoped bindings to prevent conflicts
Add PLATFORM variable (kind/openshift) to Makefile
Consolidate kubebuilder RBAC markers in api/v1alpha1/crds.go
This enables running multiple operator instances without resource conflicts.