-
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 (#356)
Signed-off-by: Griffin-Sullivan <[email protected]>
- Loading branch information
1 parent
9e024d2
commit eeb020e
Showing
8 changed files
with
180 additions
and
4 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
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,63 @@ | ||
[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 2 pods running (1 for BFF and 1 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-ui-58755c4754-zdrnr 1/1 Running 0 11s | ||
``` | ||
|
||
#### 4. Access the Model Registry UI running in the cluster | ||
Now that the pods are up and running you can access the UI. | ||
|
||
First you will need to port-forward the UI service by running the following in it's own terminal: | ||
```shell | ||
kubectl port-forward service/model-registry-ui-service 8080:8080 -n kubeflow | ||
``` | ||
|
||
You can then access the UI running in your cluster locally at http://localhost:8080/ | ||
|
||
To test the BFF separately you can also port-forward that service by running: | ||
```shell | ||
kubectl port-forward service/model-registry-bff-service 4000:4000 -n kubeflow | ||
``` | ||
|
||
You can now make API requests to the BFF endpoints like: | ||
```shell | ||
curl http://localhost:4000/api/v1/model-registry | ||
``` | ||
``` | ||
{ | ||
"model_registry": null | ||
} | ||
``` |
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,15 @@ | ||
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 | ||
|
||
images: | ||
- name: model-registry-ui-image | ||
newName: quay.io/gsulliva/mr-ui:latest | ||
- name: model-registry-bff-image | ||
newName: quay.io/gsulliva/mr-bff:latest |
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: 1 | ||
selector: | ||
matchLabels: | ||
app: model-registry-bff | ||
template: | ||
metadata: | ||
labels: | ||
app: model-registry-bff | ||
spec: | ||
containers: | ||
- name: model-registry-bff | ||
image: model-registry-bff-image | ||
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 |
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: model-registry-ui | ||
labels: | ||
app: model-registry-ui | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: model-registry-ui | ||
template: | ||
metadata: | ||
labels: | ||
app: model-registry-ui | ||
spec: | ||
containers: | ||
- name: model-registry-ui | ||
image: model-registry-ui-image | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 2Gi | ||
requests: | ||
cpu: 500m | ||
memory: 2Gi | ||
ports: | ||
- containerPort: 8080 |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: model-registry-ui-service | ||
spec: | ||
selector: | ||
app: model-registry-ui | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
name: http |