Skip to content
Terraform project to create a digitalocean kubernetes cluster
Branch: master
Clone or download
Latest commit 57d6d83 Mar 27, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin First commit Mar 26, 2019
modules First commit Mar 26, 2019
prod First commit Mar 26, 2019
.gitignore First commit Mar 26, 2019 Add prod.tfvars example Mar 26, 2019


This project will allow you to automate creating a kubernetes cluster on DigitalOcean using terraform to automate that. The cluster will have the following features:

  • Pick your cluster size, node size, region
  • Choose your version of kubernetes provided DigitalOcean supports it
  • Helm installed
  • Traefik installed as the ingress service
    • DigitalOcean load balancer in front of the redundant Traefik services
    • Lets encrypt SSL certs using your domain. Requires you host your DNS with digitalocean
  • Kubernetes Dashboard installed
  • Gitlab account created for continuous deployment
  • Easy to add more clusters such as staging/testing/etc


  1. create a file called prod/prod.tfvars with inputs matching
  2. terraform init
  3. terraform apply -var-file=autobots.tfvars
  4. cp kubeconfig.yaml ~/.kube/config

Here is an example prod.tfvars:

cluster_name = "production"
k8s_version = "1.13.4-do.0"
node_size = "s-1vcpu-2gb"
cluster_size = 2
do_zone = "nyc1"
traefik_replicas = 2
do_token = "your_do_token"
lets_encrypt_email = ""
lets_encrypt_main_domain = ""

More environments

You can setup more environments such as "staging" using this setup. Copy the prod folder to you new environment name such as "staging" and then follow the steps in Setup above


This initially comes from this medium post

You can’t perform that action at this time.