An Ansible playbook to prepare Kubernetes cluster with control plane and worker node.
Prepare ansible connection from ansible host to control plane and worker node. You can follow this document ansible setup to prepare the connection.
su - ansible
git clone https://github.com/mohammadrony/kubernetes-cluster-setup-playbook.git
Update the variables in kube control setup, kube node setup and post installation role.
Check hosts file for host-group and host-names with control plane and worker node host names. By default it would work as follows
[kcontrol]
vm-master
[knodes]
vm-worker
ansible-playbook playbook.yml
- Find the config file for the cluster from Ansible control host's
/home/ansible/kubeconfig
file. - Copy the config file to remote host's
~/.kube/config
file.
Thank you.