Skip to content

Instantly share code, notes, and snippets.

@chwzr
Created August 30, 2021 09:24
Show Gist options
  • Select an option

  • Save chwzr/1129249877460fa475e48193db31efe7 to your computer and use it in GitHub Desktop.

Select an option

Save chwzr/1129249877460fa475e48193db31efe7 to your computer and use it in GitHub Desktop.
Run k3s on host with zfs filesystem. Run this script after installing k3s, then restart k3s service
# echo "[+] making sure everything in containerd is empty to let it mount"
rm -rf /var/lib/rancher/k3s/agent/containerd/*
# echo "[+] create the k3s hierarchy"
zfs create rpool/k3s
zfs create -s -V 128GB rpool/k3s/containerd
# echo "[+] wait for the newly created volume to format"
mkfs.ext4 /dev/rpool/k3s/containerd
# echo "[+] adding the mount to fstab"
echo "/dev/rpool/k3s/containerd /var/lib/rancher/k3s/agent/containerd ext4 auto 0 0" > /etc/fstab
# echo "[+] manually mounting the volume to the specific mount point"
mount /dev/rpool/k3s/containerd /var/lib/rancher/k3s/agent/containerd
# echo "[!] if you saw this message without any error it means you're good to go"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment