k8s playground

Basic k8s cluster on vultr following tutorial at how-to-create-a-kubernetes-cluster-using-kubeadm-on-ubuntu-18-04

How to

In terraform dir:

export TF_VAR_vultr_api_key=<api-key>
terraform plan
terraform apply
# when done:
terraform destroy

Add to/edit /etc/hosts with appropriate ip addresses:

45.76.120.32 k8s.server
139.180.168.56 k8s.worker_1
45.77.234.82 k8s.worker_2

If run before first:

ssh-keygen -f "/home/mj/.ssh/known_hosts" -R "k8s.server"
ssh-keygen -f "/home/mj/.ssh/known_hosts" -R "k8s.worker_1"
ssh-keygen -f "/home/mj/.ssh/known_hosts" -R "k8s.worker_2"

Log into each instance to add key to known_hosts:

ssh root@k8s.server
ssh root@k8s.worker_1
ssh root@k8s.worker_2

Run commands in setup:

ansible-playbook -i hosts initial.yml
ansible-playbook -i hosts kube-dependencies.yml
ansible-playbook -i hosts master.yml
ansible-playbook -i hosts workers.yml