Skip to content

Commit

Permalink
Include ClusterRoles for dealing with APIs when installing
Browse files Browse the repository at this point in the history
Change-Id: I1134dc44e29cefe794f882c01e3eab951258ce0b
  • Loading branch information
alculquicondor committed Apr 6, 2022
1 parent 34eb233 commit daa37ed
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 12 deletions.
9 changes: 9 additions & 0 deletions config/rbac/batch_admin_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# permissions for end users to manage all kueue objects.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: batch-admin-role
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.kueue.x-k8s.io/batch-admin: "true"
9 changes: 9 additions & 0 deletions config/rbac/batch_user_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# permissions for end users to run jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: batch-user-role
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.kueue.x-k8s.io/batch-user: "true"
2 changes: 2 additions & 0 deletions config/rbac/clusterqueue_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterqueue-editor-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/clusterqueue_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterqueue-viewer-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
27 changes: 27 additions & 0 deletions config/rbac/job_editor_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# permissions for end users to edit jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: job-editor-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
23 changes: 23 additions & 0 deletions config/rbac/job_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# permissions for end users to view jobs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: job-viewer-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
13 changes: 13 additions & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ resources:
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
# ClusterRoles for Kueue APIs
- batch_admin_role.yaml
- batch_user_role.yaml
- clusterqueue_editor_role.yaml
- clusterqueue_viewer_role.yaml
- job_editor_role.yaml
- job_viewer_role.yaml
- queue_editor_role.yaml
- queue_viewer_role.yaml
- queuedworkload_editor_role.yaml
- queuedworkload_viewer_role.yaml
- resourceflavor_editor_role.yaml
- resourceflavor_viewer_role.yaml
2 changes: 2 additions & 0 deletions config/rbac/queue_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: queue-editor-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
3 changes: 3 additions & 0 deletions config/rbac/queue_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: queue-viewer-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/queuedworkload_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: queuedworkload-editor-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
3 changes: 3 additions & 0 deletions config/rbac/queuedworkload_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: queuedworkload-viewer-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rbac.kueue.x-k8s.io/batch-user: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand Down
8 changes: 2 additions & 6 deletions config/rbac/resourceflavor_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: resourceflavor-editor-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand All @@ -16,9 +18,3 @@ rules:
- patch
- update
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- resourceflavors/status
verbs:
- get
8 changes: 2 additions & 6 deletions config/rbac/resourceflavor_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: resourceflavor-viewer-role
labels:
rbac.kueue.x-k8s.io/batch-admin: "true"
rules:
- apiGroups:
- kueue.x-k8s.io
Expand All @@ -12,9 +14,3 @@ rules:
- get
- list
- watch
- apiGroups:
- kueue.x-k8s.io
resources:
- resourceflavors/status
verbs:
- get

0 comments on commit daa37ed

Please sign in to comment.