Access from external applications to services in the mesh¶
This page explains how external applications can be configured to access services within the mesh.
precondition:
-
The service
bookinfo.com
runs under thedefault
namespace of the meshglobal-service
-
Mesh provides
ingressgateway
gateway instance
Configuration goal: realize the external exposure of the internal service bookinfo.com
.
-
Through the URI matching method, realize the access routing of the specified page of the service
bookinfo.com
by external applications. -
Click
Traffic Governance
->Gateway Rules
->Create
to create a gateway rule for the istio gateway, and expose the service and port to the outside.The YAML example after configuration is as follows:
-
Click
OK
to return to the list of gateway rules, and you can see the prompt of successful creation. -
Click
Traffic Governance
->Virtual Service
->Create
to create routing rules to route to specified pages based on the URI in the request.The YAML example after configuration is as follows:
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, and you can see the prompt that the creation is successful.
Info
For a more intuitive operation demonstration, please refer to Video Tutorial.