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
An ASM instance of v1.13.4.46 or later is created. For more information, see Create an ASM instance.
The cluster is added to the ASM instance. For more information, see Add a cluster to an ASM instance.
At least two ingress gateways are deployed. For more information, see Create an ingress gateway.
An application is deployed in the ASM instance. For more information, see Deploy an application in an ASM instance.
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.
Log on to the ASM console. In the left-side navigation pane, choose .
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
On the Ingress Gateway page, find each of the ingress gateways with which you want to associate an Istio gateway and click YAML.
In the Edit dialog box, set the
podLabels
field and click OK.... spec: podLabels: key1: value1 ...
Associate an Istio gateway with the ingress gateways.
On the details page of the ASM instance, choose in the left-side navigation pane.
On the Gateway page, find the Istio gateway that you want to associate with the ingress gateways and click YAML in the Actions column.
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.