User Tools

Site Tools


raspberry_pi_cluster:nodes

Prearrange nodes

After a fight with k3 installation, I found it could be easier if:

Disable swap in each node

When installing Kubernetes on Linux, it’s recommended to disable swap because of how Kubernetes manages resources.

  • Memory Management: Kubernetes efficiently manages and allocates resources, including memory. Allowing an operating system to swap can interrupt Kubernetes’ memory management process.
  • Performance Issues: Swapping can lead to performance degradation. When Kubernetes needs to access something that has been swapped to disk, it must wait for it to be loaded back into memory, causing delays.
  • Predictability: Disabling swap helps ensure predictable performance, as it removes the chance of the system swapping out Kubernetes’ processes.
  • Kubernetes Design: Kubernetes is designed to work with no swapping activity. It assumes that applications are memory-resident, which means it expects them to stay in memory all the time.

Disable swap in each node

# Disable swap
sudo swapoff -a
# Edit the swap file
sudo nano /etc/dphys-swapfile
# set in the file CONF_SWAPSIZE=0

Enable cgroup in Raspberry Pi nodes

If a `FATA[0000] failed to find memory cgroup (v2)` error surfaces during the installation of k3s, it is likely because the Pi OS lacks the required cgroup configuration. Below are the steps needed to resolve this issue:

# Enable cgroup on Raspberry Pi nodes.
# Modify file /boot/cmdline.txt to include the line
#(be careful it has to be added at the end of the line)
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
raspberry_pi_cluster/nodes.txt · Last modified: 2025/02/07 11:36 by 85.219.17.206