We will install K3s using ansible.
Download or clone thek3s-ansible
repository, modify the playbook inventory, and run it:
- Download using the 'Download ZIP' link on GitHub onhttps://github.com/rancher/k3s-ansible
- Edit the Ansible inventory file
inventory/hosts.ini
, and replace the examples with the IPs orhostnamesof your master and nodes. This file describes the K3s masters and nodes to Ansible as it installs K3s. - Edit the
inventory/group_vars/all.yml
file and change theansible_user
topirate
. - Run
ansible-playbook site.yml -i inventory/hosts.ini
and wait.
To connect to the cluster, once it's built, you need to grab thekubectl
configuration from the master:
scp pirate@turing-master:~/.kube/config ~/.kube/config-turing-pi
Make sure you havekubectl
installed on your computer (you can install it followingthese directions).
Then set theKUBECONFIG
environment variable, and start runningkubectl
commands:
export KUBECONFIG=~/.kube/config-turing-pi
kubectl get nodes
You should get a list of all the Pi servers; if you do, congratulations! Your cluster is up and running.
This guide is based on the articleInstalling K3s Kubernetes on the Turing Piby Jeff Geerling
Comments (0 comments)