1+ ---
12apiVersion : rbac.authorization.k8s.io/v1
23kind : ClusterRole
34metadata :
45 name : {{ include "operator.fullname" . }}-clusterrole
56 labels :
67 {{- include "operator.labels" . | nindent 4 }}
78rules :
8- - apiGroups :
9- - " "
10- resources :
11- - nodes
12- verbs :
13- - list
14- - watch
15- # For automatic cluster domain detection
9+ # For automatic cluster domain detection.
1610 - apiGroups :
1711 - " "
1812 resources :
1913 - nodes/proxy
2014 verbs :
2115 - get
16+ # Manage core workload resources created per OpenSearchCluster.
17+ # Applied via SSA, tracked for orphan cleanup, and owned by the controller.
2218 - apiGroups :
2319 - " "
2420 resources :
2521 - configmaps
26- - endpoints
27- - pods
2822 - serviceaccounts
2923 - services
3024 verbs :
3327 - get
3428 - list
3529 - patch
36- - update
3730 - watch
31+ # RoleBinding created per role group to bind the product ClusterRole to the workload
32+ # ServiceAccount. Applied via SSA, tracked for orphan cleanup, and owned by the controller.
3833 - apiGroups :
3934 - rbac.authorization.k8s.io
4035 resources :
@@ -45,8 +40,18 @@ rules:
4540 - get
4641 - list
4742 - patch
48- - update
4943 - watch
44+ # Required to bind the product ClusterRole to the per-rolegroup ServiceAccount.
45+ - apiGroups :
46+ - rbac.authorization.k8s.io
47+ resources :
48+ - clusterroles
49+ verbs :
50+ - bind
51+ resourceNames :
52+ - {{ include "operator.name" . }}-clusterrole
53+ # StatefulSet created per role group. Applied via SSA, tracked for orphan cleanup, and
54+ # owned by the controller.
5055 - apiGroups :
5156 - apps
5257 resources :
5762 - get
5863 - list
5964 - patch
60- - update
6165 - watch
66+ # PodDisruptionBudget created per role group. Applied via SSA, tracked for orphan cleanup,
67+ # and owned by the controller.
6268 - apiGroups :
6369 - policy
6470 resources :
@@ -69,92 +75,57 @@ rules:
6975 - get
7076 - list
7177 - patch
72- - update
7378 - watch
79+ # Required for maintaining the CRDs within the operator (including the conversion webhook info).
80+ # Also for the startup condition check before the controller can run.
7481 - apiGroups :
7582 - apiextensions.k8s.io
7683 resources :
7784 - customresourcedefinitions
7885 verbs :
79- - get
8086 # Required to maintain the CRD. The operator needs to do this, as it needs to enter e.g. it's
8187 # generated certificate in the conversion webhook.
8288 {{- if .Values.maintenance.customResourceDefinitions.maintain }}
8389 - create
8490 - patch
91+ {{- end }}
8592 # Required for startup condition
8693 - list
8794 - watch
88- {{- end }}
95+ # Listener created per role group for external access. Applied via SSA, tracked for orphan
96+ # cleanup, and owned by the controller.
8997 - apiGroups :
9098 - listeners.stackable.tech
9199 resources :
92100 - listeners
93101 verbs :
102+ - create
103+ - delete
94104 - get
95105 - list
96- - watch
97106 - patch
98- - create
99- - delete
107+ - watch
108+ # Required to report reconciliation results and warnings back to the OpenSearchCluster object.
100109 - apiGroups :
101110 - events.k8s.io
102111 resources :
103112 - events
104113 verbs :
105114 - create
106115 - patch
116+ # Primary CRD: watched by the controller and read during reconciliation.
107117 - apiGroups :
108118 - {{ include "operator.name" . }}.stackable.tech
109119 resources :
110120 - {{ include "operator.name" . }}clusters
111121 verbs :
112122 - get
113123 - list
114- - patch
115124 - watch
125+ # Status subresource: updated at the end of every reconciliation.
116126 - apiGroups :
117127 - {{ include "operator.name" . }}.stackable.tech
118128 resources :
119129 - {{ include "operator.name" . }}clusters/status
120130 verbs :
121131 - patch
122- - apiGroups :
123- - rbac.authorization.k8s.io
124- resources :
125- - clusterroles
126- verbs :
127- - bind
128- resourceNames :
129- - {{ include "operator.name" . }}-clusterrole
130- ---
131- apiVersion : rbac.authorization.k8s.io/v1
132- kind : ClusterRole
133- metadata :
134- name : {{ include "operator.name" . }}-clusterrole
135- labels :
136- {{- include "operator.labels" . | nindent 4 }}
137- rules :
138- - apiGroups :
139- - " "
140- resources :
141- - configmaps
142- - secrets
143- - serviceaccounts
144- verbs :
145- - get
146- - apiGroups :
147- - events.k8s.io
148- resources :
149- - events
150- verbs :
151- - create
152- - patch
153- - apiGroups :
154- - security.openshift.io
155- resources :
156- - securitycontextconstraints
157- resourceNames :
158- - nonroot-v2
159- verbs :
160- - use
0 commit comments