Skip to content

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.

  1. Use URI matching to route external application access to specific pages of the bookinfo.com service.

    Access Route

  2. Click Traffic Management -> Gateway -> Create to create a gateway for the Istio gateway and expose the service and ports externally.

    Create Rule

    Here is an example YAML after completing the configuration:

    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: bookinfo-gateway
    spec:
      selector:
        istio: ingressgateway # Use the default controller
      servers:
      - port:
          number: 80
          name: http
          protocol: HTTP
        hosts:
        - bookinfo.com
    
  3. Click OK to return to the gateway list, where you will see a successful creation message.

  4. Click Traffic Management -> Virtual Service -> Create to create a routing rule that routes based on the URI in the request to the specified pages.

    Create Routing Rule

    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
    
  5. 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.

Comments