Skip to content

Commit

Permalink
Add manifests dir to define K8s resources for the UI
Browse files Browse the repository at this point in the history
Signed-off-by: Griffin-Sullivan <[email protected]>
  • Loading branch information
Griffin-Sullivan committed Sep 6, 2024
1 parent 327e865 commit 0015283
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 0 deletions.
42 changes: 42 additions & 0 deletions clients/ui/manifests/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[Model registry server set up]: ../../bff/docs/dev-guide.md

## Deploying the Model Registry UI in a local cluster

For this guide, we will be using kind for locally deploying our cluster. See
the [Model registry server set up] guide for prerequisites on setting up kind
and deploying the model registry server.

### Setup
#### 1. Create a kind cluster
Create a local cluster for running the MR UI using the following command:
```shell
kind create cluster
```

#### 2. Create kubeflow namespace
Create a namespace for model registry to run in, by default this is kubeflow, run:
```shell
kubectl create namespace kubeflow
```

#### 3. Deploy Model Registry UI to cluster
You can now deploy the UI and BFF to your newly created cluster using the kustomize configs in this directory:
```shell
cd clients/ui

kubectl apply -k manifests/base/ -n kubeflow
```

After a few seconds you should see 6 pods running (3 for BFF and 3 for UI):
```shell
kubectl get pods -n kubeflow
```
```
NAME READY STATUS RESTARTS AGE
model-registry-bff-746f674b99-bfvgs 1/1 Running 0 11s
model-registry-bff-746f674b99-snqbm 1/1 Running 0 11s
model-registry-bff-746f674b99-xx5nr 1/1 Running 0 11s
model-registry-ui-58755c4754-2blv5 1/1 Running 0 11s
model-registry-ui-58755c4754-bphkb 1/1 Running 0 11s
model-registry-ui-58755c4754-zdrnr 1/1 Running 0 11s
```
9 changes: 9 additions & 0 deletions clients/ui/manifests/base/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:
- model-registry-bff-role.yaml
- model-registry-bff-service.yaml
- model-registry-bff-deployment.yaml
- model-registry-ui-service.yaml
- model-registry-ui-deployment.yaml
28 changes: 28 additions & 0 deletions clients/ui/manifests/base/model-registry-bff-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: model-registry-bff
labels:
app: model-registry-bff
spec:
replicas: 3
selector:
matchLabels:
app: model-registry-bff
template:
metadata:
labels:
app: model-registry-bff
spec:
containers:
- name: model-registry-bff
image: quay.io/gsulliva/mr-bff
resources:
limits:
cpu: 500m
memory: 2Gi
requests:
cpu: 500m
memory: 2Gi
ports:
- containerPort: 4000
23 changes: 23 additions & 0 deletions clients/ui/manifests/base/model-registry-bff-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bff-service-reader
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get", "watch", "list"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: bff-read-services
subjects:
- kind: ServiceAccount
name: default
namespace: kubeflow
roleRef:
kind: ClusterRole
name: bff-service-reader
apiGroup: rbac.authorization.k8s.io
11 changes: 11 additions & 0 deletions clients/ui/manifests/base/model-registry-bff-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: model-registry-bff-service
spec:
selector:
app: model-registry-bff
ports:
- protocol: TCP
port: 4000
targetPort: 4000
29 changes: 29 additions & 0 deletions clients/ui/manifests/base/model-registry-ui-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: model-registry-ui
labels:
app: model-registry-ui
spec:
replicas: 3
selector:
matchLabels:
app: model-registry-ui
template:
metadata:
labels:
app: model-registry-ui
spec:
containers:
- name: model-registry-ui
image: quay.io/gsulliva/mr-ui
resources:
limits:
cpu: 500m
memory: 2Gi
requests:
cpu: 500m
memory: 2Gi
ports:
- containerPort: 80
- containerPort: 443
16 changes: 16 additions & 0 deletions clients/ui/manifests/base/model-registry-ui-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: model-registry-ui-service
spec:
selector:
app: model-registry-ui
ports:
- protocol: TCP
port: 80
targetPort: 80
name: http
- protocol: TCP
port: 443
targetPort: 443
name: https

0 comments on commit 0015283

Please sign in to comment.