Skip to content

Commit f54bfed

Browse files
committed
chore: Describe RBAC rules, remove unnecessary rules
1 parent 3fc9756 commit f54bfed

1 file changed

Lines changed: 46 additions & 24 deletions

File tree

deploy/helm/nifi-operator/templates/roles.yaml

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,55 @@ metadata:
55
labels:
66
{{- include "operator.labels" . | nindent 4 }}
77
rules:
8-
- apiGroups:
9-
- ""
10-
resources:
11-
- nodes
12-
verbs:
13-
- list
14-
- watch
158
# For automatic cluster domain detection
169
- apiGroups:
1710
- ""
1811
resources:
1912
- nodes/proxy
2013
verbs:
2114
- get
15+
# Manage core workload resources created per NifiCluster.
16+
# All resources are applied via Server-Side Apply (create + patch), fetched when
17+
# reconciliation is paused (get), and tracked for orphan cleanup (list + delete).
18+
# configmaps: rolegroup configuration; watched by the controller via .owns()/.watches()
19+
# services: rolegroup headless/metrics services and optional reporting-task service;
20+
# watched by the controller via .owns()
2221
- apiGroups:
2322
- ""
2423
resources:
25-
- pods
2624
- configmaps
2725
- services
28-
- endpoints
29-
- secrets
30-
- serviceaccounts
3126
verbs:
3227
- create
3328
- delete
3429
- get
3530
- list
3631
- patch
37-
- update
3832
- watch
33+
# serviceaccounts: one ServiceAccount per NifiCluster (built by build_rbac_resources);
34+
# applied via SSA + orphan cleanup; not watched by the controller
35+
- apiGroups:
36+
- ""
37+
resources:
38+
- serviceaccounts
39+
verbs:
40+
- create
41+
- delete
42+
- get
43+
- list
44+
- patch
45+
# secrets: sensitive-properties key and (when OIDC) admin-password secret;
46+
# looked up with get_opt and created with client.create() — not tracked by
47+
# cluster_resources, so no list/delete needed
48+
- apiGroups:
49+
- ""
50+
resources:
51+
- secrets
52+
verbs:
53+
- get
54+
- create
55+
# rolebindings: one RoleBinding per NifiCluster (built by build_rbac_resources);
56+
# applied via SSA + orphan cleanup; not watched by the controller
3957
- apiGroups:
4058
- rbac.authorization.k8s.io
4159
resources:
@@ -46,20 +64,21 @@ rules:
4664
- get
4765
- list
4866
- patch
49-
- update
50-
- watch
67+
# statefulsets: one StatefulSet per role group; applied via SSA + orphan cleanup;
68+
# watched by the controller via .owns()
5169
- apiGroups:
5270
- apps
5371
resources:
5472
- statefulsets
5573
verbs:
56-
- get
5774
- create
5875
- delete
76+
- get
5977
- list
6078
- patch
61-
- update
6279
- watch
80+
# jobs: optional reporting-task Job created when spec.clusterConfig.createReportingTaskJob
81+
# is enabled (NiFi 1.x only); applied via SSA + orphan cleanup; not watched by the controller
6382
- apiGroups:
6483
- batch
6584
resources:
@@ -70,8 +89,8 @@ rules:
7089
- get
7190
- list
7291
- patch
73-
- update
74-
- watch
92+
# poddisruptionbudgets: one PDB per NifiCluster role (when pdb.enabled);
93+
# applied via SSA + orphan cleanup; not watched by the controller
7594
- apiGroups:
7695
- policy
7796
resources:
@@ -82,8 +101,6 @@ rules:
82101
- get
83102
- list
84103
- patch
85-
- update
86-
- watch
87104
- apiGroups:
88105
- apiextensions.k8s.io
89106
resources:
@@ -99,39 +116,43 @@ rules:
99116
- list
100117
- watch
101118
{{- end }}
119+
# For reporting controller reconciliation results as Kubernetes Events
102120
- apiGroups:
103121
- events.k8s.io
104122
resources:
105123
- events
106124
verbs:
107125
- create
108126
- patch
127+
# listeners: one Listener per NifiCluster role (via build_group_listener);
128+
# applied via SSA + orphan cleanup; not watched by the controller
109129
- apiGroups:
110130
- listeners.stackable.tech
111131
resources:
112132
- listeners
113133
verbs:
134+
- create
135+
- delete
114136
- get
115137
- list
116-
- watch
117138
- patch
118-
- create
119-
- delete
139+
# Primary CRD: list + watch for the controller, get for direct lookups
120140
- apiGroups:
121141
- {{ include "operator.name" . }}.stackable.tech
122142
resources:
123143
- {{ include "operator.name" . }}clusters
124144
verbs:
125145
- get
126146
- list
127-
- patch
128147
- watch
148+
# Status subresource: patched via client.apply_patch_status() after each reconciliation
129149
- apiGroups:
130150
- {{ include "operator.name" . }}.stackable.tech
131151
resources:
132152
- {{ include "operator.name" . }}clusters/status
133153
verbs:
134154
- patch
155+
# AuthenticationClass: read for resolving authentication configuration
135156
- apiGroups:
136157
- authentication.stackable.tech
137158
resources:
@@ -140,6 +161,7 @@ rules:
140161
- get
141162
- list
142163
- watch
164+
# Required to bind the product ClusterRole to per-cluster ServiceAccounts
143165
- apiGroups:
144166
- rbac.authorization.k8s.io
145167
resources:

0 commit comments

Comments
 (0)