Skip to content

deploy Kubernetes to DigitalOcean via Terraform, Ansible and kubeadm.

Notifications You must be signed in to change notification settings

hervenicol/do-k8s

Repository files navigation

Abstract

These are some tools to create a kubernetes cluster in Digitalocean.

  • terraform creates the VMs
  • kubeadm manages Kubernetes configuration
  • ansible configures and runs kubeadm on the servers
  • contiv for the network layer
  • traefik as public proxy

Requirements

DigitalOcean account

  • setup your info in tf_env.sh

terraform

ansible

Using https://github.com/kairen/kubeadm-ansible

What it does

creates nodes on DO

Install kubeadm on them

and deploy kubernetes through kubeadm

Run

  • ./genkey.sh # Only once, to generate the kube user key
  • cd terraform
  • ../gen_nodes_from_manager1.sh
  • eval terraform plan $(../params.sh)
  • eval terraform apply $(../params.sh)
  • eval terraform destroy $(../params.sh)
  • ../generate_inventory.sh > ../ansible/inventory
  • cd ../ansible
  • ansible-playbook -i inventory site.yml -u root

Connect

  • ssh -i keys/kubekey kube@[manager IP]
  • contiv is available on https://[manager]:10000/

Caveats

  • kubeadm currently supports only one master, so this is not suitable for production

Todo

  • auto-update Traefik conf (kubernetes provider?)
  • Use Ansible dynamic inventory from tfstate
  • Trigger Ansible from Terraform

About

deploy Kubernetes to DigitalOcean via Terraform, Ansible and kubeadm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published