We will install K3s using ansible.
Download or clone the
k3s-ansiblerepository, modify the playbook inventory, and run it:
- 2.Edit the Ansible inventory file
inventory/hosts.ini, and replace the examples with the IPs or hostnames of your master and nodes. This file describes the K3s masters and nodes to Ansible as it installs K3s.
- 3.Edit the
inventory/group_vars/all.ymlfile and change the
ansible-playbook site.yml -i inventory/hosts.iniand wait.
To connect to the cluster, once it's built, you need to grab the
kubectlconfiguration from the master:
Make sure you have
kubectlinstalled on your computer (you can install it following these directions).
Then set the
KUBECONFIGenvironment variable, and start running
kubectl get nodes
You should get a list of all the Pi servers; if you do, congratulations! Your cluster is up and running.