Skip to content

Commit

Permalink
Update manifests wrt kubeflow/pipelines#4723
Browse files Browse the repository at this point in the history
* Update apiserver role to allow creating SubjectAccessReviews
* Add roles which get aggregated to kubeflow-view and kubeflow-edit

Original PR: kubeflow/pipelines#4723

Signed-off-by: Ilias Katsakioris <[email protected]>
  • Loading branch information
elikatsis committed Nov 18, 2020
1 parent e3bec69 commit 6ada975
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pipeline/api-service/base/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ rules:
- pods
verbs:
- delete
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create

6 changes: 6 additions & 0 deletions pipeline/installs/multi-user/api-service/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ rules:
- pods
verbs:
- delete
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
1 change: 1 addition & 0 deletions pipeline/installs/multi-user/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resources:
- cache
- metadata-writer
- istio-authorization-config.yaml
- view-edit-roles.yaml
patchesStrategicMerge:
- api-service/deployment-patch.yaml
- pipelines-ui/deployment-patch.yaml
Expand Down
114 changes: 114 additions & 0 deletions pipeline/installs/multi-user/view-edit-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# NOTE: IMPORTANT
# We need to separate out actual rules from aggregation rules due to
# https://github.com/kubernetes/kubernetes/issues/65171
# TL;DR: We can't have both aggregation and rules in a [Cluster]Role. When that
# is the case, the rules get ignored.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"
name: kubeflow-pipeline-edit
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
rules: []

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"
name: kubeflow-pipeline-view
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-view: "true"
rules: []

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
name: aggregate-to-pipeline-edit
rules:
- apiGroups:
- pipelines.kubeflow.org
resources:
- pipelines
- pipelines/versions
verbs:
- create
- delete
- apiGroups:
- pipelines.kubeflow.org
resources:
- experiments
verbs:
- archive
- create
- delete
- unarchive
- apiGroups:
- pipelines.kubeflow.org
resources:
- runs
verbs:
- archive
- create
- delete
- retry
- terminate
- unarchive
- apiGroups:
- pipelines.kubeflow.org
resources:
- jobs
verbs:
- create
- delete
- disable
- enable

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-view: "true"
name: aggregate-to-pipeline-view
rules:
- apiGroups:
- pipelines.kubeflow.org
resources:
- pipelines
- pipelines/versions
- experiments
- runs
- jobs
verbs:
- get
- list
- apiGroups:
- kubeflow.org
resources:
- viewers
verbs:
- create
- get
- delete
- apiGroups:
- pipelines.kubeflow.org
resources:
- visualizations
verbs:
- create
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ rules:
- list
- update
- patch
- delete
- delete
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
4 changes: 4 additions & 0 deletions pipeline/upstream/base/pipeline/multi-user/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- view-edit-roles.yaml
114 changes: 114 additions & 0 deletions pipeline/upstream/base/pipeline/multi-user/view-edit-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# NOTE: IMPORTANT
# We need to separate out actual rules from aggregation rules due to
# https://github.com/kubernetes/kubernetes/issues/65171
# TL;DR: We can't have both aggregation and rules in a [Cluster]Role. When that
# is the case, the rules get ignored.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"
name: kubeflow-pipeline-edit
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
rules: []

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"
name: kubeflow-pipeline-view
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-view: "true"
rules: []

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-edit: "true"
name: aggregate-to-pipeline-edit
rules:
- apiGroups:
- pipelines.kubeflow.org
resources:
- pipelines
- pipelines/versions
verbs:
- create
- delete
- apiGroups:
- pipelines.kubeflow.org
resources:
- experiments
verbs:
- archive
- create
- delete
- unarchive
- apiGroups:
- pipelines.kubeflow.org
resources:
- runs
verbs:
- archive
- create
- delete
- retry
- terminate
- unarchive
- apiGroups:
- pipelines.kubeflow.org
resources:
- jobs
verbs:
- create
- delete
- disable
- enable

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-pipeline-view: "true"
name: aggregate-to-pipeline-view
rules:
- apiGroups:
- pipelines.kubeflow.org
resources:
- pipelines
- pipelines/versions
- experiments
- runs
- jobs
verbs:
- get
- list
- apiGroups:
- kubeflow.org
resources:
- viewers
verbs:
- create
- get
- delete
- apiGroups:
- pipelines.kubeflow.org
resources:
- visualizations
verbs:
- create

0 comments on commit 6ada975

Please sign in to comment.