Deploy AWS Load Balancer Controller

In this section you will configure and deploy AWS Load Balancer Controller using an IAM role to provide it with permissions to manage AWS resources on your behalf.

Choose one of the following options to deploy AWS Load Balancer Controller:

Option 1: Deploy AWS Load Balancer Controller Automatically (preferred)

Deploy AWS Load Balancer Controller by following the on-screen instructions on the rok-deploy user interface.

If rok-deploy is not already running, start it with:

root@rok-tools:~# rok-deploy --run-from eks-alb-alb
../../../../_images/eks-alb-alb.png

Proceed to the Summary section.

Option 2: Deploy AWS Load Balancer Controller Manually

If you want to deploy AWS Load Balancer Controller manually, follow the instructions below.

Procedure

  1. Go to your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:~# cd ~/ops/deployments
    
  2. Restore the required context from previous sections:

    root@rok-tools:~/ops/deployments# source <(cat deploy/env.{eks-cluster,eks-alb-iam-alb})
    
    root@rok-tools:~/ops/deployments# export EKS_CLUSTER EKS_ALB_IAM_ALB_ROLE
    
  3. Verify that the IAM role for AWS Load Balancer Controller exists, obtain its ARN and copy it to your clipboard, as you are going to use this value in later steps:

    root@rok-tools:~/ops/deployments# aws iam get-role \
    > --role-name ${EKS_ALB_IAM_ALB_ROLE?} \
    > --query Role.Arn \
    > --output text
    arn:aws:iam::123456789012:role/rok-us-west-2-arrikto-cluster-alb
    
  4. Edit rok/aws-load-balancer-controller/overlays/deploy/patches/deploy.yaml and set --cluster-name to that of your EKS cluster:

    value: "--cluster-name=arrikto-cluster"  # <-- Update this line with your EKS_CLUSTER
    
  5. Edit rok/aws-load-balancer-controller/overlays/deploy/patches/sa.yaml and set the IAM-role-related annotation to the ARN of your IAM role for AWS Load Balancer Controller:

    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/rok-us-west-2-arrikto-cluster-alb  # <-- Update this line with the ARN
    
  6. Commit your changes:

    root@rok-tools:~/ops/deployments# git commit -am "Deploy AWS Load Balancer Controller"
    
  7. Deploy AWS Load Balancer Controller:

    root@rok-tools:~/ops/deployments# rok-deploy --apply rok/aws-load-balancer-controller/overlays/deploy
    

Verify

  1. Verify that the AWS Load Balancer Controller deployment is up-and-running. Verify field READY is 1/1:

    root@rok-tools:~# kubectl get -n kube-system deploy/aws-load-balancer-controller
    NAME                           READY   UP-TO-DATE   AVAILABLE   AGE
    aws-load-balancer-controller   1/1     1            1           1m
    

Summary

You have successfully deployed AWS Load Balancer Controller.

What's Next

The next step is to configure the ALB type and subnets.