This repository maintains reusable terraform modules to deploy Rancher and Kubernetes clusters managed by Rancher.
The modules support major infrastructure/cloud platforms (AWS, VMware, Azure, GCP, DigitalOcean). Provisioning can be customized using different Kubernetes distributions (RKE, RKE2, K3S, EKS, AKS, GKE).
The project uses two main concepts:
- Modules: Focused, reusable building blocks that handle specific infrastructure components.
- Recipes: Compositions of modules that provision full, end-to-end stacks.
We define clusters in two ways:
- Upstream (Management Cluster): The cluster where Rancher is installed and runs.
- Downstream (Workload Cluster): Clusters managed by Rancher where your applications run.
Use these steps to set up a Rancher management cluster on AWS with RKE2.
- Clone the repository and navigate to the recipe directory:
git clone https://github.com/rancher/tf-rancher-up.git cd tf-rancher-up/recipes/upstream/aws/rke2 - Create your configuration file:
cp terraform.tfvars.example terraform.tfvars
- Edit
terraform.tfvarswith your AWS credentials, region, and desired settings. - Initialize and apply the configuration:
terraform init terraform plan terraform apply
Use these steps to set up a Rancher management cluster on DigitalOcean with RKE2.
- Clone the repository and navigate to the recipe directory:
git clone https://github.com/rancher/tf-rancher-up.git cd tf-rancher-up/recipes/upstream/digitalocean/rke2 - Create your configuration file:
cp terraform.tfvars.example terraform.tfvars
- Edit
terraform.tfvarswith your DigitalOcean token, region, and desired settings. - Initialize and apply the configuration:
terraform init terraform plan terraform apply
| Provider | Upstream Recipes | Downstream/Standalone Recipes |
|---|---|---|
| Any / None | None | Custom, Imported |
| AWS | RKE, RKE2, K3S | v2, EKS, RKE, Split-roles RKE |
| Azure | RKE, RKE2, K3S, AKS | None |
| Google Cloud | RKE, RKE2, K3S, GKE | GKE |
| DigitalOcean | RKE, RKE2, K3S | None |
| VMware | RKE, RKE2, K3S | None |