Skip to content

Commit 857255b

Browse files
committed
feat: add aggregated clusterrole
kubernetes design user-facing roles: view/edit/admin. add aggregated clusterrole to support multi-tenant scenario see https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles see https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings Signed-off-by: j4ckstraw <[email protected]>
1 parent 94636bd commit 857255b

File tree

6 files changed

+77
-63
lines changed

6 files changed

+77
-63
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
description: A Helm chart for Kubernetes
33
name: kuberay-operator
4-
version: 1.1.0
4+
version: 1.1.1
55
icon: https://github.com/ray-project/ray/raw/master/doc/source/images/ray_header_logo.png
66
type: application
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# permissions for end users to view rayjobs.
2+
{{- if and .Values.rbacEnable (not .Values.singleNamespaceInstall) }}
3+
---
4+
kind: ClusterRole
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
metadata:
7+
name: raycluster-viewer-role
8+
labels:
9+
rbac.authorization.k8s.io/aggregate-to-view: "true"
10+
rules:
11+
- apiGroups:
12+
- ray.io
13+
resources:
14+
- rayjobs
15+
- rayjobs/status
16+
verbs:
17+
- get
18+
- list
19+
- watch
20+
---
21+
kind: ClusterRole
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
metadata:
24+
name: raycluster-editor-role
25+
labels:
26+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
27+
rules:
28+
- apiGroups:
29+
- ray.io
30+
resources:
31+
- rayjobs
32+
verbs:
33+
- create
34+
- update
35+
- delete
36+
- patch
37+
- deletecollection
38+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
# permissions for end users to edit rayjobs.
22
{{- if and .Values.rbacEnable (not .Values.singleNamespaceInstall) }}
3-
3+
---
44
kind: ClusterRole
55
apiVersion: rbac.authorization.k8s.io/v1
66
metadata:
7-
labels: {{ include "kuberay-operator.labels" . | nindent 4 }}
8-
name: rayjob-editor-role
7+
name: rayjob-viewer-role
8+
labels:
9+
rbac.authorization.k8s.io/aggregate-to-view: "true"
910
rules:
1011
- apiGroups:
1112
- ray.io
1213
resources:
1314
- rayjobs
15+
- rayjobs/status
1416
verbs:
15-
- create
16-
- delete
1717
- get
1818
- list
19-
- patch
20-
- update
2119
- watch
20+
---
21+
kind: ClusterRole
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
metadata:
24+
name: rayjob-editor-role
25+
labels:
26+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
27+
rules:
2228
- apiGroups:
2329
- ray.io
2430
resources:
25-
- rayjobs/status
31+
- rayjobs
2632
verbs:
27-
- get
33+
- create
34+
- delete
35+
- patch
36+
- update
37+
- deletecollection
2838
{{- end }}

helm-chart/kuberay-operator/templates/ray_rayjob_viewer_role.yaml

-24
This file was deleted.

helm-chart/kuberay-operator/templates/ray_rayservice_editor_role.yaml

-26
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
# permissions for end users to view rayservices.
22
{{- if and .Values.rbacEnable (not .Values.singleNamespaceInstall) }}
3+
---
34
apiVersion: rbac.authorization.k8s.io/v1
45
kind: ClusterRole
56
metadata:
67
name: rayservice-viewer-role
8+
labels:
9+
rbac.authorization.k8s.io/aggregate-to-view: "true"
710
rules:
811
- apiGroups:
912
- ray.io
1013
resources:
1114
- rayservices
15+
- rayservices/status
1216
verbs:
1317
- get
1418
- list
1519
- watch
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: ClusterRole
23+
metadata:
24+
name: rayservice-editor-role
25+
labels:
26+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
27+
rules:
1628
- apiGroups:
1729
- ray.io
1830
resources:
19-
- rayservices/status
31+
- rayservices
2032
verbs:
21-
- get
22-
{{- end }}
33+
- create
34+
- delete
35+
- patch
36+
- update
37+
- deletecollection
38+
{{- end }}

0 commit comments

Comments
 (0)