Skip to content

Commit 432fb90

Browse files
authored
team setup for kubernetes (#16)
1 parent 6c8d786 commit 432fb90

File tree

6 files changed

+76
-17
lines changed

6 files changed

+76
-17
lines changed

SETUP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Step by step setup instructions are provided for the following versions:
2424
+ [OpenShift AI 2.10](./setup.RHOAI-v2.10/CLUSTER-SETUP.md)
2525
<!---
2626
+ [OpenShift AI 2.11](./setup.RHOAI-v2.11/CLUSTER-SETUP.md)
27-
+ [Kubernetes 1.25+](./setup.k8s-v1.25/CLUSTER-SETUP.md)
2827
--->
28+
+ [Kubernetes 1.25+](./setup.k8s-v1.25/CLUSTER-SETUP.md)
2929

3030
## Team Setup
3131

@@ -36,8 +36,8 @@ Step by step setup instructions are provided for the following versions:
3636
+ [OpenShift AI 2.10](./setup.RHOAI-v2.10/TEAM-SETUP.md)
3737
<!---
3838
+ [OpenShift AI 2.11](./setup.RHOAI-v2.11/TEAM-SETUP.md)
39-
+ [Kubernetes 1.25+](./setup.k8s-v1.25/TEAM-SETUP.md)
4039
--->
40+
+ [Kubernetes 1.25+](./setup.k8s-v1.25/TEAM-SETUP.md)
4141

4242
## Quota Maintenance
4343

@@ -91,5 +91,5 @@ and reclaim the corresponding namespaces.
9191
+ [OpenShift AI 2.10](./setup.RHOAI-v2.10/UNINSTALL.md)
9292
<!---
9393
+ [OpenShift AI 2.11](./setup.RHOAI-v2.11/UNINSTALL.md)
94+
--->
9495
+ [Kubernetes 1.25+](./setup.k8s-v1.25/UNINSTALL.md)
95-
--->

setup.RHOAI-v2.10/TEAM-SETUP.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Team Setup
22

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

4-
The team setup creates a project, a user group, a quota, a queue, and the
5-
required role bindings.
5+
6+
Setting up a new team requires the cluster admin to create a project,
7+
a user group, a quota, a queue, and the required role bindings as described below.
68

79
Create project:
810
```sh

setup.RHOAI-v2.11/TEAM-SETUP.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Team Setup
22

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

4-
The team setup creates a project, a user group, a quota, a queue, and the
5-
required role bindings.
5+
6+
Setting up a new team requires the cluster admin to create a project,
7+
a user group, a quota, a queue, and the required role bindings as described below.
68

79
Create project:
810
```sh

setup.k8s-v1.25/TEAM-SETUP.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
# Team Setup
22

3-
The team setup creates a namespace, a user group, a quota, a queue, and the
4-
required role bindings.
3+
A *team* in MLBatch is a group of users that share a resource quota.
4+
5+
Setting up a new team requires the cluster admin to create a namespace,
6+
a quota, a queue, and the required role bindings as described below.
57

68
Create namespace:
79
```sh
810
kubectl create namespace team1
911
```
1012

11-
*** UNDER CONSTRUCTION***
13+
For each user on the team, create a RoleBinding:
14+
```sh
15+
kubectl -n team 1 apply -f- << EOF
16+
kind: RoleBinding
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
metadata:
19+
name: user-one
20+
subjects:
21+
- kind: User
22+
apiGroup: rbac.authorization.k8s.io
23+
name: user-one
24+
roleRef:
25+
apiGroup: rbac.authorization.k8s.io
26+
kind: ClusterRole
27+
name: mlbatch-edit
28+
EOF
29+
```
1230

1331
Specify the intended quota for the namespace by creating a `ClusterQueue`:
1432
```sh

setup.k8s-v1.25/UNINSTALL.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
# Under Construction!
1+
# Uninstall
2+
3+
To uninstall the MLBatch controllers and reclaim the corresponding namespaces,
4+
do the following:
5+
```sh
6+
# Delete operators and CRDs
7+
kubectl delete -k setup.k8s-v1.25/appwrapper
8+
kubectl delete -k setup.k8s-v1.25/kueue
9+
kubectl delete -k setup.k8s-v1.25/kuberay
10+
kubectl delete -k setup.k8s-v1.25/training-operator
11+
12+
# Delete namespace
13+
kubectl delete namespace mlbatch-system
14+
15+
# Delete clusterole
16+
kubectl delete clusterrole mlbatch-edit
17+
18+
# Coscheduler uninstall
19+
helm uninstall -n scheduler-plugins scheduler-plugins
20+
kubectl delete namespace scheduler-plugins
21+
```

setup.tmpl/TEAM-SETUP.md.tmpl

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Team Setup
22

3+
A *team* in MLBatch is a group of users that share a resource quota.
4+
35
{{ if .OPENSHIFT }}
4-
The team setup creates a project, a user group, a quota, a queue, and the
5-
required role bindings.
6+
Setting up a new team requires the cluster admin to create a project,
7+
a user group, a quota, a queue, and the required role bindings as described below.
68

79
Create project:
810
```sh
@@ -21,16 +23,31 @@ Bind cluster role to group in namespace:
2123
{{ .KUBECTL }} adm policy add-role-to-group mlbatch-edit team1-edit-group --role-namespace="" --namespace team1
2224
```
2325
{{- else -}}
24-
The team setup creates a namespace, a user group, a quota, a queue, and the
25-
required role bindings.
26+
Setting up a new team requires the cluster admin to create a namespace,
27+
a quota, a queue, and the required role bindings as described below.
2628

2729
Create namespace:
2830
```sh
2931
{{ .KUBECTL }} create namespace team1
3032
```
3133

32-
*** UNDER CONSTRUCTION***
33-
34+
For each user on the team, create a RoleBinding:
35+
```sh
36+
{{ .KUBECTL }} -n team 1 apply -f- << EOF
37+
kind: RoleBinding
38+
apiVersion: rbac.authorization.k8s.io/v1
39+
metadata:
40+
name: user-one
41+
subjects:
42+
- kind: User
43+
apiGroup: rbac.authorization.k8s.io
44+
name: user-one
45+
roleRef:
46+
apiGroup: rbac.authorization.k8s.io
47+
kind: ClusterRole
48+
name: mlbatch-edit
49+
EOF
50+
```
3451
{{- end }}
3552

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

0 commit comments

Comments
 (0)