-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add manifests dir to define K8s resources for the UI
Signed-off-by: Griffin-Sullivan <[email protected]>
- Loading branch information
1 parent
327e865
commit 0015283
Showing
7 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
clients/ui/manifests/base/model-registry-bff-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
29
clients/ui/manifests/base/model-registry-ui-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |