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
The service account in the remote cluster must have the necessary RBAC permissions for your operator to function. Edit the RBAC templates in the `rbac/` directory to define the permissions your operator needs:
84
+
The script automatically creates RBAC resources with the necessary permissions for your operator. By default, it uses the rules defined in `scripts/rules.yaml`:
53
85
54
86
```yaml
55
-
# rbac/clusterrole.yaml
56
-
apiVersion: rbac.authorization.k8s.io/v1
57
-
kind: ClusterRole
58
-
metadata:
59
-
name: ${SECRET_NAME}-role
60
87
rules:
61
-
# Add permissions for your operator <--------------------------------
62
-
- apiGroups: [""]
63
-
resources: ["configmaps"]
64
-
verbs: ["list", "get", "watch"] # watch is needed for controllers that observe resources
88
+
- apiGroups: [""]
89
+
resources: ["configmaps"]
90
+
verbs: ["list", "get", "watch"]
65
91
```
66
92
67
-
Important RBAC considerations:
68
-
- Use `watch` verb if your controller needs to observe resource changes
69
-
- Use `list` and `get` for reading resources
70
-
- Use `create`, `update`, `patch`, `delete` for modifying resources
71
-
- Consider using `Role` instead of `ClusterRole` if you only need namespace-scoped permissions
93
+
#### Customizing RBAC Rules
94
+
95
+
You can customize the RBAC permissions by:
96
+
97
+
1. **Editing the default rules file** (`scripts/rules.yaml`):
echo"ERROR: Failed to verify kubeconfig - unable to list pods."
121
-
echo"- Ensure that the service account '${NAMESPACE}/${SERVICE_ACCOUNT}' on cluster '${KUBECONFIG_CONTEXT}' has the necessary permissions to list pods."
282
+
echo"ERROR: Failed to verify kubeconfig - unable to connect to cluster."
283
+
echo"- Ensure that the service account '${NAMESPACE}/${SERVICE_ACCOUNT}' on cluster '${KUBECONFIG_CONTEXT}' exists and is properly configured."
122
284
echo"- You may specify a namespace using the -n flag."
123
285
echo"- You may specify a service account using the -a flag."
0 commit comments