Accessing Services Inside the Mesh from External Applications¶
This page explains how external applications can access services inside the mesh through configuration.
Prerequisites:
-
The service bookinfo.com is running in the default namespace of the mesh global-service .
-
The mesh provides an ingressgateway instance.
Objective: Expose the internal service bookinfo.com to the outside.
-
Use URI matching to route external application access to specific pages of the bookinfo.com service.
-
Click Traffic Management -> Gateway -> Create to create a gateway for the Istio gateway and expose the service and ports externally.
Here is an example YAML after completing the configuration:
-
Click OK to return to the gateway list, where you will see a successful creation message.
-
Click Traffic Management -> Virtual Service -> Create to create a routing rule that routes based on the URI in the request to the specified pages.
Here is an example YAML after completing the configuration:
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: bookinfo spec: hosts: - bookinfo.com gateways: - bookinfo-gateway http: - match: - uri: exact: /productpage - uri: exact: /login - uri: exact: /logout - uri: prefix: /api/v1/products route: - destination: host: productpage port: number: 9080
-
Click OK to return to the virtual service list, where you will see a successful creation message.
Info
For more detailed instructions, you can refer to the video tutorial.