I am new to Istio and I am trying to communicate 2 spring boot applications with Istio: component with requirement.
- I have installed Istio 1.13.2 on a GKE cluster with the demo profile:
istioctl install --set profile=demo -y
- I have automatically injected the sidecar proxy to the default namespace with:
kubectl label namespace default istio-injection=enabled
- I have defined istio ingress gateway as entry point and a virtual service that points to the component service.
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: my-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-gateway-vs
spec:
hosts:
- "*"
gateways:
- my-gateway
http:
- match:
- uri:
prefix: /component
route:
- destination:
host: component
port:
number: 8080
---
component app only has an enpoint: /component that returns a string, So far everything works fine.
The flow is as follows
my-gateway----->component
My question is how I can communicate component with requirement directly without going through istio-ingress-gateway.
my-gateway----->component ---->requirement
Is it possible?
Note: I have tried adding requirements in the virtual service but it seems to go through the istio-ingress-gateway and not directly from component to requirement.
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: my-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-gateway-vs
spec:
hosts:
- "*"
gateways:
- my-gateway
http:
- match:
- uri:
prefix: /component
route:
- destination:
host: component
port:
number: 8080
- match:
- uri:
prefix: /requirement
route:
- destination:
host: requirement
port:
number: 8080
---