Skip to content

Commit

Permalink
Add ODH overlay
Browse files Browse the repository at this point in the history
Augments the `default` profile with some changes expected by an ODH installation:
* Removes the `Namespace` CR, because the ODH operator does not expect such resource. The Namespace is expected to be created in advance to later create a KfDef on it, where resources are going to be installed.
* Adds cluster roles, to extend the cluster's default user-facing roles with KServe privileges.

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>
  • Loading branch information
israel-hdez committed Aug 1, 2023
1 parent 23c823c commit 50d33ed
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/overlays/odh/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../default
- user-cluster-roles.yaml

patchesStrategicMerge:
- remove-namespace.yaml
6 changes: 6 additions & 0 deletions config/overlays/odh/remove-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Remove namespace resource as namespace will already exist.
$patch: delete
apiVersion: v1
kind: Namespace
metadata:
name: kserve
57 changes: 57 additions & 0 deletions config/overlays/odh/user-cluster-roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kserve-admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-kserve-admin: "true"
rules: []

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kserve-edit
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-kserve-admin: "true"
rules:
- apiGroups:
- serving.kserve.io
resources:
- inferenceservices
- servingruntimes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kserve-view
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rules:
- apiGroups:
- kubeflow.org
resources:
- servingruntimes
- servingruntimes/status
- servingruntimes/finalizers
- inferenceservices
- inferenceservices/status
- inferenceservices/finalizers
verbs:
- get
- list
- watch

0 comments on commit 50d33ed

Please sign in to comment.