Provide a collection of resources for people to setup a kubernetes cluster with Orange Pi single board computers.
- Orange Pi(s) running Ubuntu
- NOTE: You can use as few as 2. In my setup, I used 5.
- A system with Ansible installed
- NOTE: See Ansible's Installation Guide
In order for ansible to connect to your Orange Pi systems you will need to setup a couple of things:
- Network
- Access
To configure the network for you Orange Pi(s) you can use nmtui
, I recommend using the onboard ethernet connection as I experienced intermittent issues with WiFi.
After network is setup, creating an account for Ansible is simple. SSH to each Orange Pi and complete the following steps.
sudo adduser adm_ansible
- Type in the password and user details
sudo adduser adm_ansible sudo
exit
Now that we have a Ansible user account on each machine, we need to create and add our SSH key for easy and secure access. On your local system open Terminal (MacOS and Linux) or PowerShell (Windows) and complete the following steps.
ssh-keygen -t ed25519 -c "adm_ansible"
- NOTE: I recommend naming your key id_adm_ansible
ssh-copy-id -i <path to id_adm_ansible.pub> adm_ansible@<machine name>
- Replace with the full path to the ssh key created in Step 1, adding .pub to the end.
- Repeat for each Orange Pi system, replacing with each Orange Pi's system name or ip address.
ssh-add -K <path to id_adm_ansible>
- Replace with the full path to the ssh key created in Step 1.
Now the final step is to update the inventory file , src/production.yml
, to fit your configuration. Simply add or remove hosts to the master
or nodes
host groups. Note that you should only have a single master host.
After setup is complete using the solution is simple, run the following commands in Terminal (MacOS and Linux) or PowerShell (Windows).
cd src
ansible-playbook cluster-build.yml -i production.yml --ask-become-pass
- NOTE: You will be prompted for the password for adm_ansible for sudo purposes.
Now remote into the master node and run the following command to verify all nodes are in the cluster.