Skip to content

Commit 008f198

Browse files
committed
chore: Split operator and product RBAC rules
1 parent 07a2706 commit 008f198

2 files changed

Lines changed: 30 additions & 29 deletions

File tree

deploy/helm/hbase-operator/templates/roles.yaml renamed to deploy/helm/hbase-operator/templates/clusterrole-operator.yaml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: ClusterRole
34
metadata:
@@ -125,32 +126,3 @@ rules:
125126
- {{ include "operator.name" . }}clusters/status
126127
verbs:
127128
- patch
128-
---
129-
# Product ClusterRole: bound (via per HbaseCluster RoleBinding) to the ServiceAccount that HBase
130-
# workload pods (masters, regionServers, restServers) run as.
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-
# Allows HBase pods to emit Kubernetes events (e.g. for lifecycle notifications).
139-
- apiGroups:
140-
- events.k8s.io
141-
resources:
142-
- events
143-
verbs:
144-
- create
145-
- patch
146-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
147-
# Required on OpenShift to allow the HBase pods to run as a non-root user.
148-
- apiGroups:
149-
- security.openshift.io
150-
resources:
151-
- securitycontextconstraints
152-
resourceNames:
153-
- nonroot-v2
154-
verbs:
155-
- use
156-
{{ end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
# Product ClusterRole: bound (via per HbaseCluster RoleBinding) to the ServiceAccount that HBase
3+
# workload pods (masters, regionServers, restServers) run as.
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: ClusterRole
6+
metadata:
7+
name: {{ include "operator.name" . }}-clusterrole
8+
labels:
9+
{{- include "operator.labels" . | nindent 4 }}
10+
rules:
11+
# Allows HBase pods to emit Kubernetes events (e.g. for lifecycle notifications).
12+
- apiGroups:
13+
- events.k8s.io
14+
resources:
15+
- events
16+
verbs:
17+
- create
18+
- patch
19+
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
20+
# Required on OpenShift to allow the HBase pods to run as a non-root user.
21+
- apiGroups:
22+
- security.openshift.io
23+
resources:
24+
- securitycontextconstraints
25+
resourceNames:
26+
- nonroot-v2
27+
verbs:
28+
- use
29+
{{ end }}

0 commit comments

Comments
 (0)