All Products
Search
Document Center

Alibaba Cloud Service Mesh:Configure an Istio gateway for multiple ingress gateway services

Last Updated:Jun 05, 2023

An ingress gateway service provides a unified entrance for routing the inbound traffic at Layer 7. It routes HTTP requests from the same TCP-based port to different Kubernetes Services based on the request content. This topic describes how to configure an Istio gateway for multiple ingress gateway services in a Service Mesh (ASM) instance.

Prerequisites

Background information

In this example, two A records are configured for the xxx.xxx.cn domain name. The two A records correspond to two Server Load Balancer (SLB) instances. The two SLB instances correspond to two ingress gateway services in an ASM instance. The two ingress gateway services require the same Istio gateway. To ensure that the two ingress gateway services share the same Istio gateway, you need to associate an Istio gateway with both ingress gateway services one by one. ASM allows you to configure an Istio gateway for multiple ingress gateway services in a few steps. This simplifies the configuration of the Istio gateway.

Procedure

You can map an Istio gateway to multiple ingress gateway services. The spec.selector field of a Gateway resource is used to select the ingress gateways with which the Istio gateway will be associated. Ingress gateways with a label that match the selector are selected. In this example, the label key1: value1 is specified as the selector.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.
  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose ASM Gateways > Ingress Gateway.
  3. On the Ingress Gateway page, find each of the ingress gateway services with which you want to associate an Istio gateway and click YAML .

  4. In the Edit dialog box, set the podLabels field and click OK.

    ...
    spec:
      podLabels:
        key1: value1
    ...
  5. Associate an Istio gateway with the ingress gateway services.

    1. On the details page of the ASM instance, choose ASM Gateways > Gateway in the left-side navigation pane.

    2. On the Gateway page, find the Istio gateway that you want to associate with the ingress gateway services and click YAML in the Actions column.

    3. In the Edit dialog box, set the spec.selector field and click OK.

      apiVersion: networking.istio.io/v1beta1
      kind: Gateway
      metadata:
        name: bookinfo-gateway
        namespace: default
      spec:
        selector:
          key1: value1
        servers:
          - hosts:
              - '*'
            port:
              name: http
              number: 80
              protocol: HTTP