Created
August 30, 2021 09:24
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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