Skip to content

Commit

Permalink
Add Istio overlay for UI integration with Central Dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Griffin-Sullivan <[email protected]>
  • Loading branch information
Griffin-Sullivan committed Nov 26, 2024
1 parent a12fd00 commit fc8c411
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clients/ui/manifests/base/model-registry-ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ spec:
- containerPort: 8080
env:
- name: API_URL
value: "http://model-registry-bff-service:4000"
value: "http://model-registry-bff-service.kubeflow.svc.cluster.local:4000"
- name: APP_PREFIX
value: /modelRegistry
- name: USERID_HEADER
value: kubeflow-userid
- name: USERID_PREFIX
value: /modelRegistry
- name: APP_SECURE_COOKIES
value: $(VWA_APP_SECURE_COOKIES)
33 changes: 33 additions & 0 deletions clients/ui/manifests/overlays/istio/authorization-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: model-registry-ui
namespace: kubeflow
spec:
action: ALLOW
rules:
- from:
- source:
principals:
- cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account
selector:
matchLabels:
app: model-registry-ui

---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: model-registry-bff
namespace: kubeflow
spec:
action: ALLOW
rules:
- from:
- source:
principals:
- cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account
selector:
matchLabels:
app: model-registry-bff
23 changes: 23 additions & 0 deletions clients/ui/manifests/overlays/istio/destination-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: model-registry-ui
namespace: kubeflow
spec:
host: model-registry-ui-service.kubeflow.svc.cluster.local
trafficPolicy:
tls:
mode: ISTIO_MUTUAL

---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: model-registry-bff
namespace: kubeflow
spec:
host: model-registry-bff-service.kubeflow.svc.cluster.local
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
13 changes: 13 additions & 0 deletions clients/ui/manifests/overlays/istio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- virtual-service.yaml
- authorization-policy.yaml
- destination-rule.yaml
namespace: kubeflow
commonLabels:
app: model-registry-ui
kustomize.component: model-registry-ui
configurations:
- params.yaml
3 changes: 3 additions & 0 deletions clients/ui/manifests/overlays/istio/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/http/route/destination/host
kind: VirtualService
56 changes: 56 additions & 0 deletions clients/ui/manifests/overlays/istio/virtual-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: model-registry-ui
namespace: kubeflow
spec:
gateways:
- kubeflow-gateway
hosts:
- '*'
http:
# Rule for the main application path
- match:
- uri:
prefix: /modelRegistry/
rewrite:
uri: /
headers:
request:
add:
x-forwarded-prefix: /modelRegistry
route:
- destination:
host: model-registry-ui-service.kubeflow.svc.cluster.local
port:
number: 8080

# Rules for static assets
- match:
- uri:
exact: /main.bundle.js
route:
- destination:
host: model-registry-ui-service.kubeflow.svc.cluster.local
port:
number: 8080

- match:
- uri:
exact: /styles.css
route:
- destination:
host: model-registry-ui-service.kubeflow.svc.cluster.local
port:
number: 8080

# Add additional static assets as needed
- match:
- uri:
prefix: /static/
route:
- destination:
host: model-registry-ui-service.kubeflow.svc.cluster.local
port:
number: 8080

0 comments on commit fc8c411

Please sign in to comment.