All Products
Search
Document Center

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

Last Updated:Feb 06, 2024

An ingress gateway 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 gateways 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 map to two Classic Load Balancer (CLB) instances. The two CLB instances are respectively associated with two ingress gateways in an ASM instance. The two ingress gateways require the same Istio gateway. To ensure that the two ingress gateways share the same Istio gateway, you need to associate an Istio gateway with both ingress gateways one by one. ASM allows you to configure an Istio gateway for multiple ingress gateways in a few simple steps. This simplifies the configuration of the Istio gateway. For more information about the fields of an ingress gateway and an Istio gateway, see CRD fields for an ASM gateway and Gateway.

Procedure

You can map an Istio gateway to multiple ingress gateways. 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 matches 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 gateways 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 gateways.

    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 gateways and click YAML in the Actions column.

    3. In the Edit dialog box, set the 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                         

What to do next

Istio gateways are used to only configure proxies to listen on ports. You must also configure virtual services to specify traffic forwarding rules. For more information about the fields of a virtual service, see Virtual Service. For more information about how to create a virtual service, see Manage virtual services.