Skip to content

team setup for kubernetes #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Step by step setup instructions are provided for the following versions:
+ [OpenShift AI 2.10](./setup.RHOAI-v2.10/CLUSTER-SETUP.md)
<!---
+ [OpenShift AI 2.11](./setup.RHOAI-v2.11/CLUSTER-SETUP.md)
+ [Kubernetes 1.25+](./setup.k8s-v1.25/CLUSTER-SETUP.md)
--->
+ [Kubernetes 1.25+](./setup.k8s-v1.25/CLUSTER-SETUP.md)

## Team Setup

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

## Quota Maintenance

Expand Down Expand Up @@ -91,5 +91,5 @@ and reclaim the corresponding namespaces.
+ [OpenShift AI 2.10](./setup.RHOAI-v2.10/UNINSTALL.md)
<!---
+ [OpenShift AI 2.11](./setup.RHOAI-v2.11/UNINSTALL.md)
--->
+ [Kubernetes 1.25+](./setup.k8s-v1.25/UNINSTALL.md)
--->
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
24 changes: 21 additions & 3 deletions setup.k8s-v1.25/TEAM-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
# 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 -n team 1 apply -f- << EOF
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: user-one
subjects:
- kind: User
apiGroup: rbac.authorization.k8s.io
name: user-one
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
22 changes: 21 additions & 1 deletion setup.k8s-v1.25/UNINSTALL.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# Under Construction!
# Uninstall

To uninstall the MLBatch controllers and reclaim the corresponding namespaces,
do the following:
```sh
# Delete operators and CRDs
kubectl delete -k setup.k8s-v1.25/appwrapper
kubectl delete -k setup.k8s-v1.25/kueue
kubectl delete -k setup.k8s-v1.25/kuberay
kubectl delete -k setup.k8s-v1.25/training-operator

# Delete namespace
kubectl delete namespace mlbatch-system

# Delete clusterole
kubectl delete clusterrole mlbatch-edit

# Coscheduler uninstall
helm uninstall -n scheduler-plugins scheduler-plugins
kubectl delete namespace scheduler-plugins
```
29 changes: 23 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,31 @@ 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 }} -n team 1 apply -f- << EOF
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: user-one
subjects:
- kind: User
apiGroup: rbac.authorization.k8s.io
name: user-one
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