Skip to content

Commit

Permalink
fix: refactor istio virtualservice to support routes for REST interna…
Browse files Browse the repository at this point in the history
…l and external routing, and gRPC internal routing (#2)

* fix: refactor istio virtualservice to support routes for REST internal and external routing, and gRPC internal routing

* fix: simplify istio config by excluding DB port and enabling istio sidecar injection in model registry deployment
  • Loading branch information
dhirajsb authored May 27, 2024
1 parent 696fc57 commit b0fd5ad
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 10 deletions.
2 changes: 2 additions & 0 deletions manifests/kustomize/base/model-registry-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
component: model-registry-server
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
labels:
component: model-registry-server
spec:
Expand Down
2 changes: 2 additions & 0 deletions manifests/kustomize/base/model-registry-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ spec:
ports:
- port: 8080
protocol: TCP
appProtocol: http
name: http-api
- port: 9090
protocol: TCP
appProtocol: grpc
name: grpc-api
21 changes: 11 additions & 10 deletions manifests/kustomize/options/istio/virtual-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ spec:
- '*'
http:
- match:
- uri:
prefix: /model-registry/
rewrite:
uri: /
- uri:
prefix: /api/model_registry/
route:
- destination:
host: model-registry-service.kubeflow.svc.cluster.local
port:
number: 8080
tcp:
- match:
- port: 9090
- port: 9090
- authority:
regex: model-registry-service(\..+)?(:9090)?
- uri:
prefix: /ml_metadata.MetadataStoreService/
route:
- destination:
host: model-registry-service.kubeflow.svc.cluster.local
port:
number: 9090
- destination:
host: model-registry-service.kubeflow.svc.cluster.local
port:
number: 9090
7 changes: 7 additions & 0 deletions manifests/kustomize/overlays/db/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ vars:
apiVersion: v1
kind: Service
name: model-registry-db
- name: MYSQL_PORT
objref:
kind: ConfigMap
name: model-registry-db-parameters
apiVersion: v1
fieldref:
fieldpath: data.MYSQL_PORT
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ metadata:
name: model-registry-deployment
spec:
template:
metadata:
annotations:
# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts: $(MYSQL_PORT)
spec:
containers:
- name: rest-container
Expand Down
7 changes: 7 additions & 0 deletions manifests/kustomize/overlays/postgres/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ vars:
apiVersion: v1
fieldref:
fieldpath: metadata.name
- name: POSTGRES_PORT
objref:
kind: ConfigMap
name: model-registry-db-parameters
apiVersion: v1
fieldref:
fieldpath: data.POSTGRES_PORT
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ metadata:
name: model-registry-deployment
spec:
template:
metadata:
annotations:
# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts: $(POSTGRES_PORT)
spec:
containers:
- name: grpc-container
Expand Down

0 comments on commit b0fd5ad

Please sign in to comment.