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
- setup your info in tf_env.sh
- http://www.terraform.io/downloads.html
- https://www.digitalocean.com/community/tutorials/how-to-use-terraform-with-digitalocean
Using https://github.com/kairen/kubeadm-ansible
creates nodes on DO
Install kubeadm on them
- https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
- https://kubernetes.io/docs/setup/independent/install-kubeadm/
and deploy kubernetes through kubeadm
- ./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
- ssh -i keys/kubekey kube@[manager IP]
- contiv is available on https://[manager]:10000/
- kubeadm currently supports only one master, so this is not suitable for production
- auto-update Traefik conf (kubernetes provider?)
- Use Ansible dynamic inventory from tfstate
- Trigger Ansible from Terraform