119 lines
3.5 KiB
Markdown
119 lines
3.5 KiB
Markdown
# pi-servers
|
||
|
||

|
||
|
||
<!-- TOC -->
|
||
|
||
- [pi-servers](#pi-servers)
|
||
- [Principe](#principe)
|
||
- [Process](#process)
|
||
- [Flasher Debian 12 Headless sur carte SD avec Balena etcher](#flasher-debian-12-headless-sur-carte-sd-avec-balena-etcher)
|
||
- [Démarrer le Raspberry Pi](#d%C3%A9marrer-le-raspberry-pi)
|
||
- [Cloner rpi-clone sur la carte SD](#cloner-rpi-clone-sur-la-carte-sd)
|
||
- [Lancer le processus de clonage vers le NVMe](#lancer-le-processus-de-clonage-vers-le-nvme)
|
||
- [Configurer le Raspberry Pi pour démarrer depuis le NVMe :warning: IMPORTANT](#configurer-le-raspberry-pi-pour-d%C3%A9marrer-depuis-le-nvme-warning-important)
|
||
- [Overclocker le Raspberry Pi](#overclocker-le-raspberry-pi)
|
||
- [Redémarrer le Raspberry Pi](#red%C3%A9marrer-le-raspberry-pi)
|
||
- [Configurer le playbook Ansible inventory.yaml](#configurer-le-playbook-ansible-inventoryyaml)
|
||
- [Provisionner les Raspberry Pis pour créer le cluster](#provisionner-les-raspberry-pis-pour-cr%C3%A9er-le-cluster)
|
||
- [Documentation](#documentation)
|
||
- [TODO](#todo)
|
||
|
||
<!-- /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:
|
||
|
||
### Flasher Debian 12 Headless sur carte SD avec [Balena etcher](https://etcher.balena.io/)
|
||
|
||
- Télécharger l’image PI-OS de [Bookworm Lite](https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz)
|
||
|
||
- Flasher l’OS sur la carte SD
|
||
|
||
### Démarrer le Raspberry Pi
|
||
|
||
### Cloner rpi-clone sur la carte SD
|
||
|
||
Cloner ce dépôt Git : 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
|
||
```
|
||
|
||
### Lancer le processus de clonage vers le NVMe
|
||
|
||
Cloner vers le disque NVMe (généralement `nvme0n1`, mais vérifier avec `lsblk`) :
|
||
```bash
|
||
sudo rpi-clone nvme0n1
|
||
```
|
||
|
||
> Valider et choisir ext4 comme système de fichiers
|
||
|
||
### Configurer le Raspberry Pi pour démarrer depuis le NVMe :warning: **IMPORTANT**
|
||
|
||
- Modifier le fichier `/boot/firmware/config.txt`:
|
||
```bash
|
||
dtparam=pciex1
|
||
```
|
||
|
||
- Changer l’ordre de démarrage:
|
||
```bash
|
||
sudo rpi-eeprom-config --edit
|
||
```
|
||
|
||
- Modifier la ligne `BOOT_ORDER` comme suit:
|
||
```bash
|
||
BOOT_ORDER=0xf416
|
||
```
|
||
|
||
### Overclocker le Raspberry Pi
|
||
|
||
- Modifier le fichier `/boot/firmware/config.txt`:
|
||
```bash
|
||
# Tell the DVFS algorithm to increase voltage by this amount (in µV; default 0).
|
||
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
|
||
```
|
||
|
||
### Redémarrer le Raspberry Pi
|
||
|
||
```bash
|
||
sudo reboot
|
||
```
|
||
|
||
### Configurer le playbook Ansible (inventory.yaml)
|
||
|
||
- Cloner ce dépôt Git: https://git.legaragenumerique.fr/GARAGENUM/ansible-garage-kluster
|
||
|
||
- Modifier le fichier `inventory.yaml`:
|
||
```bash
|
||
cd ansible-garage-kluster/
|
||
nano inventory.yaml
|
||
```
|
||
|
||
- Configurer les adresses IP du Master et des Workers
|
||
|
||
### Provisionner les Raspberry Pis pour créer le cluster
|
||
|
||
- Lancer le 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)
|