You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/en/docs/building-operators/golang/migration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,7 @@ See the complete migrated `memcached_controller.go` code [here][memcached_contro
228
228
229
229
**Note:** The version of [controller-runtime][controller-runtime] used in the projects scaffolded by SDK `0.19.x+` was `v0.6.0`. Please check [sigs.k8s.io/controller-runtime release docs from 0.7.0+ version][controller-runtime] for breaking changes.
230
230
231
-
##### Updating your ServiceAccount in Go operator projects
231
+
##### Updating your ServiceAccount
232
232
233
233
New Go projects come with a ServiceAccount `controller-manager` in `config/rbac/service_account.yaml`.
234
234
Your project's RoleBinding and ClusterRoleBinding subjects, and Deployment's `spec.template.spec.serviceAccountName`
@@ -87,8 +87,8 @@ its controller because the [Manager][ctrl-manager] does not manage that Namespac
87
87
## Restricting Roles and permissions
88
88
89
89
An operator's scope defines its [Manager's][ctrl-manager] cache's scope but not the permissions to access the resources.
90
-
After updating the Manager's scope to be Namespaced, the cluster's [Role-Based Access Control (RBAC)][k8s-rbac]
91
-
permissions should be restricted accordingly.
90
+
After updating the Manager's scope to be Namespaced, [Role-Based Access Control (RBAC)][k8s-rbac] permissions
91
+
applied to the operator's service account should be restricted accordingly.
92
92
93
93
These permissions are found in the directory `config/rbac/`. The `ClusterRole` in `role.yaml` and `ClusterRoleBinding`
94
94
in `role_binding.yaml` are used to grant the operator permissions to access and manage its resources.
@@ -99,33 +99,13 @@ and `auth_proxy_*.yaml` are not relevant to changing the operator's resource per
99
99
100
100
### Changing the permissions to Namespaced
101
101
102
-
To change the scope of the RBAC permissions from cluster-wide to a specific namespace, you will need to use `Role`s
103
-
=======
104
-
105
-
- Inform the Namespace to the [Manager][ctrl-manager]
102
+
To change the scope of the RBAC permissions from cluster-wide to a specific namespace, you will need to:
106
103
107
-
By default, the [Manager][ctrl-manager] does not have any namespace specified in `main.go`, and hence it will watch all the namespaces. In order to restrict the controllers to watch a specific namespace, specify it while creating the manager. Update the `NewManager` to inform the Namespace, in our `Memcahced` example it would like:
0 commit comments