Kubernetes HA using Ansible (creates only master nodes)
This code was written so we can test kubernetes clusters on local machines. But the main purpose of this code is to create kubernetes clusters on bare metal machines. Our goal was to only have master nodes in the cluster and that’s why you won’t see code for worker nodes. Adding provisioning of worker nodes to this playbook should be easy as most of the code is independent.
What you need to have installed on ansible host:
If you don’t want to run vagrant you can just go to ansible and modify the hosts.example
file
This playbook only works on CentOS/RedHat
cd ansible
cp hosts.example hosts
# Modify the hosts file to your needs
ansible-playbook -i hosts playbook.yml
Here is how it works:
keepalived -> haproxy -> kube-apiserver
In this playbook we are only creating etcd cluster and k8s master nodes in HA. We are not creating worker nodes. Worker nodes will be added later the the playbook.
Here are the following steps:
creates
checks to vagrant
directory… this should be changed!Example:
args:
creates: /home/vagrant/.kube/config