mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
3.1 KiB
3.1 KiB
Raspberry Pi OS
- Disable WiFi and Bluetooth
- Swap
- Run containers
- Store files on the SD even when the overlay file system is active
- Further readings
- Sources
Disable WiFi and Bluetooth
Through boot configuration
Disable one or both in the all section of /boot/config.txt:
[all]
dtoverlay=disable-wifi
dtoverlay=disable-bt
Through rfkill
-
block one or both:
rfkill block wifi rfkill block bluetooth -
check they are correctly soft-blocked:
rfkill list
Swap
Disable the swap file.
sudo systemctl disable --now 'dphys-swapfile'
Run containers
- enable the kernel's containerization feature
- disable swap
- if kubernetes is involved, set up the firewall to use the legacy configuration
Kernel containerization features
Enable containerization features in the kernel to be able to run containers as intended.
Add the following properties at the end of the line in /boot/cmdline.txt:
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
sed -i '/cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1/!s/\s*$/ cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1&/' /boot/cmdline.txt
Firewall settings
Switch Debian firewall to use the legacy configuration:
update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
Store files on the SD even when the overlay file system is active
The files just need to be stored on a different file system from /. You can partition the SD and use that, or create a file and mount it as a virtual file system:
truncate -s '6G' 'file'
mkfs.ext4 'file'
mkdir 'mount/point'
sudo mount -t 'ext4' -o 'loop' 'file' 'mount/point'
sudo chown 'user':'group' 'mount/point'
touch 'mount/point/new-file'
Further readings
Sources
- The k3s project page
- The Build your very own self-hosting platform with Raspberry Pi and Kubernetes series of articles
- Run Kubernetes on a Raspberry Pi with k3s
- Project's issue 2067