Install Istio With Application Load Balancer¶
By default, Istio creates an AWS Classic Load Balancer during installation. However, we'll be setting up Istio to utilize the AWS Application Load Balancer due to its superior features compared to the Classic Load Balancer.
Step 1: Install Istio with NodePort Service Type¶
By default, Istio creates an AWS Classic Load Balancer during installation because the istio-ingressgateway service type is set to LoadBalancer.
We'll change the service type to NodePort, so no load balancer is created at first. Then, we'll create an ingress object for the istio-ingressgateway service, which will create an AWS Application Load Balancer using the AWS Load Balancer Controller.
Install Istio with service type set to NodePort:
# Install istio
istioctl install --set profile=default --set values.gateways.istio-ingressgateway.type=NodePort -y
The output should look similar to the below:
Verify the service type of istio-ingressgateway service:
Step 2: Configure istio-ingressgateway Service to Use Application Load Balancer¶
-
Note down the
nodePortvalue of istio-ingressgateway service:Note down the value of
nodePortfrom.spec.portsthat corresponds tostatus-port. -
Note down the health check path of istio-ingressgateway service:
Note down the health check path for the
readinessProbe. -
Edit the istio-ingressgateway service to add alb annotations:
Edit the
istio-ingressgatewayservice by adding annotations that aws application load balancer controller can use to configure health check for this target.Note
The default kubectl editor is vim. You can change it to nano as follows:
Use
kubectl editcommand to edit theistio-ingressgatewayservice:Edit the service by adding the following annotations in
.metadata.annotations:alb.ingress.kubernetes.io/healthcheck-port: "30594" alb.ingress.kubernetes.io/healthcheck-path: /healthz/readyMake sure to change the
healthcheck-portvalue to thenodePortvalue you noted earlier. The same goes forhealthcheck-path. Make sure to change it to the health check path you recorded.
Now, describe the service to check if everything is fine:
Step 3: Create Ingress for the istio-ingressgateway Service¶
Now, let's create and deploy ingress for the istio-ingressgateway service which in turn will create an application load balancer that sends traffic to istio-ingressgateway service.
Make sure to replace the certificate-arn with the arn of certificate you created in ACM.
Apply the manifest to create ingress:
List ingress resources:
Verify that a target group and an application load balancer was created. Also, verify that the targets are in healthy state.