Skip to content

Instantly share code, notes, and snippets.

@dkeightley
Last active December 14, 2021 12:29
Show Gist options
  • Save dkeightley/1b1214c965be20d21c0840cb4e96b1a5 to your computer and use it in GitHub Desktop.
Save dkeightley/1b1214c965be20d21c0840cb4e96b1a5 to your computer and use it in GitHub Desktop.
Rancher with ALB Controller

Install the ALB controller

I installed it via helm without IAM roles for Service Accounts (IRSA) configured for the EKS cluster, so the controller pods used the policy's attached to the underlying instance profile of the worker nodes.

Install Rancher

To deploy Rancher, I used the following helm install command, note using a values file can make this syntax clearer and easier.

helm install rancher rancher-stable/rancher \
  --namespace cattle-system --create-namespace=true \
  --set hostname=<rancher hostname> \
  --set replicas=2 \
  --version 2.6.2 \
  --set tls=external \
  --set ingress.extraAnnotations.'alb\.ingress\.kubernetes\.io/target-type'='ip' \
  --set ingress.extraAnnotations.'alb\.ingress\.kubernetes\.io/scheme'='internet-facing' \
  --set ingress.extraAnnotations.'kubernetes\.io/ingress\.class'='alb' \
  --set ingress.extraAnnotations.'alb\.ingress\.kubernetes\.io/certificate-arn'='arn:aws:acm:region:account:certificate/id'

As you can see, I used ACM and terminated SSL only on the ALB (--set tls=external), with an internet-facing ALB. Be sure to replace the Rancher hostname, version, replicas and ACM ARN

Note, the target-type of ip is needed when not exposing the service outside of the cluster. The controller will auto-discover subnets by default, so tagging is needed for each subnet in use.

Once the ALB is provisioned you can adjust the DNS for your Rancher hostname to point to the ALB, in Route53 this is best as an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment