Skip to content

Commit 52a2621

Browse files
committed
chore: simplify the rule descriptions
1 parent 31f466c commit 52a2621

1 file changed

Lines changed: 17 additions & 23 deletions

File tree

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

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ rules:
1515
- get
1616
# Manage core workload resources created per HiveCluster.
1717
# All resources are applied via Server-Side Apply (create + patch) and tracked for
18-
# orphan cleanup (list + delete). get is also needed for the ReconciliationPaused strategy.
19-
# ConfigMaps and Services are watched by the controller (.owns()) so they also need watch.
20-
# - configmaps: role group configuration and discovery ConfigMaps
21-
# - services: headless and metrics Services per role group
18+
# orphan cleanup (list + delete).
2219
- apiGroups:
2320
- ""
2421
resources:
@@ -31,8 +28,8 @@ rules:
3128
- list
3229
- patch
3330
- watch
34-
# ServiceAccount created per cluster instance by build_rbac_resources.
35-
# Applied via SSA and tracked for orphan cleanup. Not watched by the controller.
31+
# ServiceAccount created per HiveCluster for workload pod identity.
32+
# Applied via SSA and tracked for orphan cleanup.
3633
- apiGroups:
3734
- ""
3835
resources:
@@ -43,9 +40,8 @@ rules:
4340
- get
4441
- list
4542
- patch
46-
# RoleBinding created per cluster instance by build_rbac_resources, binding the
47-
# product ClusterRole to the per-cluster ServiceAccount.
48-
# Applied via SSA and tracked for orphan cleanup. Not watched by the controller.
43+
# RoleBinding created per HiveCluster to bind the product ClusterRole to the workload
44+
# ServiceAccount. Applied via SSA and tracked for orphan cleanup.
4945
- apiGroups:
5046
- rbac.authorization.k8s.io
5147
resources:
@@ -56,8 +52,8 @@ rules:
5652
- get
5753
- list
5854
- patch
59-
# StatefulSet created per role group. Applied via SSA and tracked for orphan cleanup.
60-
# Watched by the controller (.owns()).
55+
# StatefulSet created per role group. Applied via SSA, tracked for orphan cleanup, and
56+
# owned by the controller.
6157
- apiGroups:
6258
- apps
6359
resources:
@@ -69,8 +65,7 @@ rules:
6965
- list
7066
- patch
7167
- watch
72-
# PodDisruptionBudget created per role for availability guarantees.
73-
# Applied via SSA and tracked for orphan cleanup. Not watched by the controller.
68+
# PodDisruptionBudget created per role. Applied via SSA and tracked for orphan cleanup.
7469
- apiGroups:
7570
- policy
7671
resources:
@@ -97,16 +92,15 @@ rules:
9792
# Required for startup condition
9893
- list
9994
- watch
100-
# For emitting Kubernetes events during reconciliation.
95+
# Required to report reconciliation results and warnings back to the HiveCluster object.
10196
- apiGroups:
10297
- events.k8s.io
10398
resources:
10499
- events
105100
verbs:
106101
- create
107102
- patch
108-
# Watch HiveCluster objects (the primary CRD) and read them during reconciliation.
109-
# get is also needed for the ReconciliationPaused strategy.
103+
# Primary CRD: watched by Controller::new() and read during reconciliation.
110104
- apiGroups:
111105
- {{ include "operator.name" . }}.stackable.tech
112106
resources:
@@ -115,14 +109,14 @@ rules:
115109
- get
116110
- list
117111
- watch
118-
# For patching the status subresource of HiveCluster objects via apply_patch_status.
112+
# Status subresource: updated at the end of every reconciliation.
119113
- apiGroups:
120114
- {{ include "operator.name" . }}.stackable.tech
121115
resources:
122116
- {{ include "operator.name" . }}clusters/status
123117
verbs:
124118
- patch
125-
# Read S3Connection objects to configure the metastore's S3 storage.
119+
# Read S3Connection configuration referenced in the HiveCluster spec.
126120
- apiGroups:
127121
- s3.stackable.tech
128122
resources:
@@ -131,7 +125,7 @@ rules:
131125
- get
132126
- list
133127
- watch
134-
# Bind the product ClusterRole to per-cluster ServiceAccounts.
128+
# Required to bind the product ClusterRole to the per-cluster ServiceAccount.
135129
- apiGroups:
136130
- rbac.authorization.k8s.io
137131
resources:
@@ -140,8 +134,8 @@ rules:
140134
- bind
141135
resourceNames:
142136
- {{ include "operator.name" . }}-clusterrole
143-
# Listener resource created per role for load balancer / NodePort access.
144-
# Applied via SSA and tracked for orphan cleanup. Not watched by the controller.
137+
# Listener created per role group for external access. Applied via SSA and tracked for orphan
138+
# cleanup.
145139
- apiGroups:
146140
- listeners.stackable.tech
147141
resources:
@@ -160,7 +154,7 @@ metadata:
160154
labels:
161155
{{- include "operator.labels" . | nindent 4 }}
162156
rules:
163-
# For workload pods to emit Kubernetes events.
157+
# Allows Hive pods to emit Kubernetes events.
164158
- apiGroups:
165159
- events.k8s.io
166160
resources:
@@ -169,7 +163,7 @@ rules:
169163
- create
170164
- patch
171165
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
172-
# Required on OpenShift to allow the workload pods to run as non-root.
166+
# Required on OpenShift to allow the Hive pods to run as a non-root user.
173167
- apiGroups:
174168
- security.openshift.io
175169
resources:

0 commit comments

Comments
 (0)