Welcome to the easiest, chillest, and most ๐ฅ way to spin up Rancher High Availability (HA) clusters on AWS using RKE2!
Just vibe, tweak a config, run a test, and you're Rancher-ready. ๐โก๏ธ๐
โ
No Cert Manager needed โ SSL is done via AWS ACM ๐
โ
Secure by default โ HTTPS from the jump ๐
โ
All you gotta do:
- ๐ ๏ธ Tweak the generated
install.sh
(if you even want to...) - ๐ Run it โ donezo.
We install Rancher using:
--set tls=external
Because ACM certs are already there, TLS is handled. No drama. Just Rancher ๐ฎ๐
This repo helps you:
- ๐ Deploy 3-node RKE2 HA clusters with Terraform
- ๐ง Auto-configure each node & wire them up over a secure ALB
- ๐ Use AWS ACM for certs โ no cert-manager required!
- โ๏ธ Generate a custom
install.sh
script to install Rancher in 1 command - ๐ฏ All driven by a single test function, because... we love automation
Put your tool-config.yml
next to this README โ right at the project root:
.
โโโ README.md
โโโ tool-config.yml ๐งโโ๏ธ (put it here)
โโโ go.mod
โโโ terratest/
โ โโโ test.go
โโโ modules/
โ โโโ aws/
Run this to build everything (with timeout so it doesnโt hang forever):
go test -v -run TestHaSetup -timeout 60m ./terratest
๐ This will:
- ๐ Launch EC2s, ALBs, and Route53 DNS records
- ๐ Setup TLS with AWS ACM certs
- ๐ง Bootstrap and join all 3 nodes into RKE2
- ๐ Drop a ready-to-run Rancher
install.sh
in each HA folder
Navigate to your HA cluster directory (like high-availability-1/
) and run:
./install.sh
This installs Rancher securely via ALB + ACM certs with TLS ๐
No cert-manager needed. No cluster pain. Just good vibes and cattle โจ๐
When you're done, run cleanup:
go test -v -run TestHACleanup -timeout 20m ./terratest
๐ฅ This will:
- ๐จ Destroy all infra via Terraform
- ๐งน Clean up generated files and folders
- ๐งผ Leave your AWS nice and tidy
๐ Where to find available rke2 k8s versions:
๐จโ๐พ๐งโRKE2 v1.32.X Release Notes ๐จโ๐พ๐งโโ๏ธ
aws:
rsa_private_key: |
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
rancher:
bootstrap_password: ""
image_tag: "v2.11.0"
version: "2.11.0"
k8s:
version: "v1.31.4+rke2r1"
total_has: 2 # Number of HA clusters to create
tf_vars:
aws_access_key: "super-secret-key"
aws_secret_key: "super-secret-key"
aws_prefix: "xyz" # your initials, keep it short!
aws_vpc: ""
aws_subnet_a: ""
aws_subnet_b: ""
aws_subnet_c: ""
aws_ami: ""
aws_subnet_id: ""
aws_security_group_id: ""
aws_pem_key_name: ""
aws_route53_fqdn: ""
Each HA setup creates a folder like:
high-availability-1/
โโโ install.sh ๐ One-command Rancher installer
โโโ kube_config.yaml ๐ Your RKE2 kubeconfig
You're basically a Rancher wizard now ๐งโโ๏ธโจ
This tool was built to make Rancher HA setup fun, secure, and dead simple.
With Terraform, RKE2, and ACM doing the heavy lifting โ you just ride the Rancher wave ๐๐
Pull requests welcome. Questions welcome. Rancher users always welcome.
Happy HA'ing! ๐๐ฎ๐ซ
๐ Built with Go, Terraform, and Rancher love.