Successor to the Docker Compose based monitoring lab, this time in Kubernetes.
The hosts in the inventory are reachable and you can authenticate with your SSH key to the ubuntu user on each machine.
- Create 5 VMs with ubuntu user
- Add SSH public key to ~/.ssh/authorized_keys of ubuntu user
- Make sure all hosts are reachable via hostname from ansible machine.
- ansible
- 5 servers (VMs): k8s1, k8s2, k8s3, k8skw1, k8skw2
Run the ansible playbook:
ansible-playbook configure-k8s-cluster.yml
If you need to target specific tags or hosts, here are some examples:
# Install dependencies on all hosts
ansible-playbook configure-k8s-cluster.yml -t setup
# Other examples
ansible-playbook configure-k8s-cluster.yml -t hostname --limit control_nodes
ansible-playbook configure-k8s-cluster.yml -t k8s --limit primary_control_node,secondary_control_nodes
Update ubuntu
ansible-playbook update-ubuntu.yml
Get k8s version
ansible-playbook get-k8s-versions.yml