Skip to content
Terraform for Building rancher HA k8s cluster on DigitalOcean
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.terraform-version
LICENSE
README.md
droplet.tf
make.sh
provider.tf
rke.yml.tmpl
ssh_key.tf
userdata.sh
variables.tf

README.md

rancher-ha-tf-do

Building HA Rancher 2.x server on DigitalOcean using Terraform and RKE

Prerequisite

  • Terraform binary (tfenv recommended)
  • DigitalOcean account and API Token
  • Own your custom domain and register zone in DigitalOcean DNS service
  • jq command

Usage

clone this repository

git clone https://github.com/yteraoka/rancher-ha-tf-do.git

Build HA Rancher cluster

export DIGITALOCEAN_TOKEN=***
export DOMAIN_SUFFIX=your.own.example.com
export CERT_EMAIL=user@example.com # for Let's Encrypt
./make.sh up

Then open https://rancher.${DOMAIN_SUFFIX}/

rke creates kube_config_rke.yml. If you want to access k8s using kubectl copy it to ~/.kube/config or set environment variable KUBECONFIG=kube_config_rke.yml.

Destroy cluster

Delete droplet (server), Load Balancer and DNS record.

export DIGITALOCEAN_TOKEN=***
export DOMAIN_SUFFIX=your.own.example.com
export CERT_EMAIL=user@example.com # for Let's Encrypt
./make.sh destroy
You can’t perform that action at this time.