Skip to content

Commit

Permalink
team setup for kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss committed Jul 11, 2024
1 parent 6c8d786 commit 55f2def
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 13 deletions.
6 changes: 4 additions & 2 deletions setup.RHOAI-v2.10/TEAM-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Team Setup

A *team* in MLBatch is a group of users that share a resource quota.

The team setup creates a project, a user group, a quota, a queue, and the
required role bindings.

Setting up a new team requires the cluster admin to create a project,
a user group, a quota, a queue, and the required role bindings as described below.

Create project:
```sh
Expand Down
6 changes: 4 additions & 2 deletions setup.RHOAI-v2.11/TEAM-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Team Setup

A *team* in MLBatch is a group of users that share a resource quota.

The team setup creates a project, a user group, a quota, a queue, and the
required role bindings.

Setting up a new team requires the cluster admin to create a project,
a user group, a quota, a queue, and the required role bindings as described below.

Create project:
```sh
Expand Down
25 changes: 22 additions & 3 deletions setup.k8s-v1.25/TEAM-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# Team Setup

The team setup creates a namespace, a user group, a quota, a queue, and the
required role bindings.
A *team* in MLBatch is a group of users that share a resource quota.

Setting up a new team requires the cluster admin to create a namespace,
a quota, a queue, and the required role bindings as described below.

Create namespace:
```sh
kubectl create namespace team1
```

*** UNDER CONSTRUCTION***
For each user on the team, create a RoleBinding:
```sh
kubectl apply -f- << EOF
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: basic-users
namespace: team1
subjects:
- kind: User
apiGroup: rbac.authorization.k8s.io
name: the-users-name
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: mlbatch-edit
EOF
```

Specify the intended quota for the namespace by creating a `ClusterQueue`:
```sh
Expand Down
30 changes: 24 additions & 6 deletions setup.tmpl/TEAM-SETUP.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Team Setup

A *team* in MLBatch is a group of users that share a resource quota.

{{ if .OPENSHIFT }}
The team setup creates a project, a user group, a quota, a queue, and the
required role bindings.
Setting up a new team requires the cluster admin to create a project,
a user group, a quota, a queue, and the required role bindings as described below.

Create project:
```sh
Expand All @@ -21,16 +23,32 @@ Bind cluster role to group in namespace:
{{ .KUBECTL }} adm policy add-role-to-group mlbatch-edit team1-edit-group --role-namespace="" --namespace team1
```
{{- else -}}
The team setup creates a namespace, a user group, a quota, a queue, and the
required role bindings.
Setting up a new team requires the cluster admin to create a namespace,
a quota, a queue, and the required role bindings as described below.

Create namespace:
```sh
{{ .KUBECTL }} create namespace team1
```

*** UNDER CONSTRUCTION***

For each user on the team, create a RoleBinding:
```sh
{{ .KUBECTL }} apply -f- << EOF
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: basic-users
namespace: team1
subjects:
- kind: User
apiGroup: rbac.authorization.k8s.io
name: the-users-name
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: mlbatch-edit
EOF
```
{{- end }}

Specify the intended quota for the namespace by creating a `ClusterQueue`:
Expand Down

0 comments on commit 55f2def

Please sign in to comment.