This Ansible playbook sets up a Kubernetes cluster with one Master and two Workers (Tested on Ubuntu 22.04 and Ubuntu 24.04 ), designed for educational purposes. For production environments, it's recommended to use Kubespray.
- Set up SSH configuration (based on RSA keys) between the master and worker nodes.
- Install Ansible on the master node (Ansible makes changes locally to the master node).
Update the default values in the host_vars directory with your master and worker nodes' IPs or domains.
Verify the connection:
ansible all -m ping
Navigate to the playbook directory and execute the playbook:
cd playbooks
ansible-playbook cluster.yml
Wait for a few minutes for the Kubernetes cluster to be set up and running.
For more advanced or production-ready setups, consider using Kubespray.