K8s with CRI-O by Ansible on RPi 4 - A project for learning Ansible and Kubernetes
I'm interested in Ansible and Kubernetes and want to learn to use them.
The plan is to use one RPi as a control node with ansible installed and a 2,5" USB HDD attached as external mass storage.
3 additional RPi will be used as one master and two worker nodes. All RPi are connected to a PoE switch so I can poweron/poweroff the three RPi 4 externally.
Because of network boot for the three RPi 4 the plugged-in SD-Card is used as mass-storage for K8s with GlusterFS installed.
The whole environment is seperated by a VLAN at the pfSense Firewall.
- 1x Raspberry Pi 3 Modell B - control
- 1x Seagate BarraCuda Pro Compute 500GB - external storage
- 3x Raspberry Pi 4 Modell B, 4GB RAM - master & worker
- 4x SanDisk Extreme Plus R170/W90 microSDXC 128GB Kit, UHS-I U3, A2, Class 10
- 1x Ubiquiti UniFi US-8-60W - PoE Switch
- 1x Zotac ZBOX CI327 - Firewall
- OS: Raspbian Lite
- Additional Packages:
- ansible
- python-argcomplete
- git
- sshpass
- OS: Raspbian Lite
- OS: pfSense
- install all RPi
- update/upgrade RPi and install ansible and clone project at control node
- update/upgrade RPi and enable network boot at master & control node
- download Raspbian OS from: https://www.raspberrypi.org/downloads/raspbian/
- install the OS image: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
- enable SSH: https://www.raspberrypi.org/documentation/remote-access/ssh/
- plug-in the flashed SD-Card and boot RPi
You can find a detailed description here
- update the firmware and upgrade all installed packages
- install the packages:
- ansible
- python-argcomplete
- git
- sshpass
- activate
python-argcomplete
and reboot - create the folder
/ext/repo
- clone the project into
/ext/repo/project_automation
You can find a detailed description here
- update the firmware and upgrade all installed packages
- enable network boot
- switch into cloned repository folder
cd /ext/repo/project_automation
-
for detailed informations see roles:
-
login as user pi
-
run playbook
control.yml
with taginstall
sudo ansible-playbook -i inventory control.yml --tags "install"
- reboot
sudo reboot
- login as new created user
- run playbook
control.yml
with taginstall
sudo ansible-playbook -i inventory control.yml --tags "install"
-
for detailed informations see role:
-
run playbook
control.yml
with taggitea
sudo ansible-playbook -i inventory control.yml --tags "gitea"
-
for detailed informations see role:
-
run playbook
control.yml
with tagpxe
sudo ansible-playbook -i inventory control.yml --tags "pxe"
-
for detailed informations see role:
-
run playbook
nodes.yml
with tagupdate
ansible-playbook -i inventory nodes.yml --tags "update" -u pi --ask-pass --become
-
for detailed informations see roles:
-
run playbook
nodes.yml
with taginstall
ansible-playbook -i inventory nodes.yml --tags "install"
-
for detailed informations see roles:
-
run playbook
nodes.yml
with taggluster
ansible-playbook -i inventory nodes.yml -u steled --tags "gluster"