You can associate multiple Classic Load Balancer (CLB) instances with a Service Mesh (ASM) ingress gateway so that multiple CLB instances can be used to access the ingress gateway. This topic describes how to access an ingress gateway by using multiple CLB instances that are associated with the ingress gateway.
Prerequisites
The cluster is added to the ASM instance. For more information, see Add a cluster to an ASM instance.
An ingress gateway is deployed in the Container Service for Kubernetes (ACK) cluster that is added to the ASM instance. For more information, see Create an ingress gateway.
After the ingress gateway is deployed, a service named istio-ingressgateway is automatically created in the ACK cluster.
The Bookinfo application and Istio resources are deployed in the ASM instance so that the Bookinfo application can be accessed by using the ingress gateway. For more information, see Deploy an application in an ASM instance and Use Istio resources to route traffic to different versions of a service.
Procedure
You need to create an additional CLB instance for the ingress gateway by creating a service with which the CLB instance is associated.
If you delete the service associated with the CLB instance, the CLB instance is also deleted.
Log on to the ACK console.
In the left-side navigation pane of the ACK console, click Clusters.
On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
In the left-side navigation pane of the details page, choose
In the upper part of the Services page, set the Namespace parameter to istio-system and click Create Resources in YAML in the upper-right corner.
On the Create page, select Custom from the Sample Template drop-down list, enter the following content in the Template field, and then click Create.
ImportantThe value of the nodePort parameter cannot be the same as an existing port number.
apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/alibaba-cloud-loadbalancer-spec: slb.s1.small service.beta.kubernetes.io/alicloud-loadbalancer-address-type: internet labels: app: istio-ingressgateway asm-system: 'true' istio: ingressgateway name: istio-ingressgateway-2 namespace: istio-system spec: externalTrafficPolicy: Cluster ports: - name: http-0 nodePort: 30544 port: 80 protocol: TCP targetPort: 80 - name: https-2 nodePort: 30682 port: 443 protocol: TCP targetPort: 443 selector: app: istio-ingressgateway asm-system: 'true' istio: ingressgateway provider: asm sessionAffinity: None type: LoadBalancer
name: the name of the service to be created. In this example, the value is set to istio-ingressgateway-2.
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-spec: the specifications of the CLB instance. Valid values: slb.s1.small, slb.s2.small, slb.s2.medium, slb.s3.small, slb.s3.medium, and slb.s3.large.
service.beta.kubernetes.io/alicloud-loadbalancer-address-type: the network type of the CLB instance to be created. Valid values:
internet: an Internet-facing CLB instance
intranet: an internal-facing CLB instance
After the service is created, a CLB instance is automatically created.
Access the ingress gateway by using multiple CLB instances.
Obtain the IP addresses using port 80 of the istio-ingressgateway and istio-ingressgateway-2 services in the External IP column on the Services page.
Enter http://<IP address of the istio-ingressgateway service>/productpage and http://<IP address of the istio-ingressgateway-2 service}>/productpage in the address bar of the browser.
If the page of the Bookinfo application appears after you enter each of the URLs, the preceding configurations take effect. In this case, you can access the ingress gateway by using multiple CLB instances.