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.{envvars-aws,aws-vpc,eks-cluster,eks-alb-iam-alb})
    root@rok-tools:~/ops/deployments# export EKS_CLUSTER EKS_ALB_IAM_ALB_ROLE > AWS_DEFAULT_REGION AWS_VPC_ID
  3. Render the AWS Load Balancer Controller deployment patch template with the variables you have specified:

    root@rok-tools:~/ops/deployments# j2 \ > rok/aws-load-balancer-controller/overlays/deploy/patches/deploy.yaml.j2 \ > -o rok/aws-load-balancer-controller/overlays/deploy/patches/deploy.yaml
  4. Obtain the ARN of the IAM role for AWS Load Balancer Controller:

    root@rok-tools:~/ops/deployments# export ROLE_ARN=$(aws iam get-role \ > --role-name ${EKS_ALB_IAM_ALB_ROLE?} \ > --query Role.Arn \ > --output text)
  5. Render the AWS Load Balancer Controller service account patch template with the variables you have specified:

    root@rok-tools:~/ops/deployments# j2 \ > rok/aws-load-balancer-controller/overlays/deploy/patches/sa.yaml.j2 \ > -o rok/aws-load-balancer-controller/overlays/deploy/patches/sa.yaml
  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.