122 lines
3.2 KiB
Markdown
122 lines
3.2 KiB
Markdown
# pi-servers
|
|
|
|

|
|
|
|
<!-- TOC -->
|
|
|
|
- [pi-servers](#pi-servers)
|
|
- [Principe](#principe)
|
|
- [Process](#process)
|
|
- [Flash Debian 12 Headless on SD card with Balena etcher](#flash-debian-12-headless-on-sd-card-with-balena-etcher)
|
|
- [Boot the raspberry](#boot-the-raspberry)
|
|
- [Clone rpi-clone on SD card](#clone-rpi-clone-on-sd-card)
|
|
- [Launch the clone process to Nvme](#launch-the-clone-process-to-nvme)
|
|
- [Config the raspberry pi to boot from Nvme :warning: IMPORTANT**](#config-the-raspberry-pi-to-boot-from-nvme-warning-important)
|
|
- [Reboot](#reboot)
|
|
- [Overclock the raspberry](#overclock-the-raspberry)
|
|
- [Config the Ansible playbook inventory.yaml](#config-the-ansible-playbook-inventoryyaml)
|
|
- [Provision the raspberry pis to create the cluster](#provision-the-raspberry-pis-to-create-the-cluster)
|
|
- [Documentation](#documentation)
|
|
|
|
<!-- /TOC -->
|
|
|
|
## Principe
|
|
|
|
Installer un cluster K3S sur des raspberry pi 5 avec l'os sur Nvme.
|
|
|
|
## Process
|
|
|
|
Pour chaque Raspberry pi du cluster, répéter ce process:
|
|
|
|
### Flash Debian 12 Headless on SD card with [Balena etcher](https://etcher.balena.io/)
|
|
|
|
|
|
### Boot the raspberry
|
|
|
|
|
|
### Clone rpi-clone on SD card
|
|
|
|
Git clone this repo: https://github.com/geerlingguy/rpi-clone.git:
|
|
```bash
|
|
git clone https://github.com/geerlingguy/rpi-clone.git
|
|
cd rpi-clone
|
|
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin
|
|
```
|
|
|
|
### Launch the clone process to Nvme
|
|
|
|
Clone to the NVMe drive (usually nvme0n1, but check with `lsblk`):
|
|
```bash
|
|
sudo rpi-clone nvme0n1
|
|
```
|
|
|
|
### Config the raspberry pi to boot from Nvme :warning: IMPORTANT**
|
|
|
|
- Edit the `/boot/firmware/config.txt file`:
|
|
```bash
|
|
dtparam=pciex1
|
|
|
|
# Note: You could also just add the following (it is an alias to the above line)
|
|
# dtparam=nvme
|
|
|
|
# Optionally, you can control the PCIe lane speed using this parameter
|
|
# dtparam=pciex1_gen=3
|
|
```
|
|
|
|
- Change the boot order:
|
|
```bash
|
|
sudo rpi-eeprom-config --edit
|
|
```
|
|
|
|
- Change the last bit to `6`:
|
|
```bash
|
|
|
|
# Change the BOOT_ORDER line to the following:
|
|
BOOT_ORDER=0xf416
|
|
```
|
|
|
|
### Reboot
|
|
|
|
```bash
|
|
sudo reboot
|
|
```
|
|
|
|
### Overclock the raspberry
|
|
|
|
- Edit the `/boot/firmware/config.txt` file:
|
|
```bash
|
|
# Tell the DVFS algorithm to increase voltage by this amount (in µV; default 0).
|
|
# IMPORTANT: See note below
|
|
over_voltage_delta=50000
|
|
|
|
# Set the Arm A76 core frequency (in MHz; default 2400).
|
|
arm_freq=3000
|
|
|
|
# Set the VideoCore VII core frequency (in MHz; default 800).
|
|
gpu_freq=1000
|
|
```
|
|
|
|
### Config the Ansible playbook (inventory.yaml)
|
|
|
|
- Git clone this repo: https://git.legaragenumerique.fr/GARAGENUM/ansible-garage-kluster
|
|
|
|
- Edit the `inventory.yaml` file:
|
|
```bash
|
|
cd ansible-garage-kluster/
|
|
nano inventory.yaml
|
|
```
|
|
|
|
- Configure the Master and Workers IPs
|
|
|
|
### Provision the raspberry pis to create the cluster
|
|
|
|
- Launch the playbook:
|
|
```bash
|
|
ansible-playbook -i inventory.yaml install-k3s-playbook.yaml
|
|
```
|
|
|
|
## Documentation
|
|
|
|
- [Overclocking](https://www.jeffgeerling.com/blog/2023/overclocking-and-underclocking-raspberry-pi-5)
|
|
- [SD to Nvme](https://www.jeffgeerling.com/blog/2023/nvme-ssd-boot-raspberry-pi-5)
|
|
- [K3S installation](https://git.legaragenumerique.fr/GARAGENUM/ansible-garage-kluster) |