The standard data location used for k3s is /run/k3s
, /var/lib/kubelet/pods
, /var/lib/rancher
.
Because this directory contains all
containers/images/volumes, it can be large. So you no need to store this in OS Volume when you can use separate
data volume.
# systemctl stop k3s
# systemctl stop k3s-agent
# /usr/local/bin/k3s-killall.sh
# mv /run/k3s/ /datadrive/k3s/
# mv /var/lib/kubelet/pods/ /datadrive/k3s-pods/
# mv /var/lib/rancher/ /datadrive/k3s-rancher/
# ln -s /datadrive/k3s/ /run/k3s
# ln -s /datadrive/k3s-pods/ /var/lib/kubelet/pods
# ln -s /datadrive/k3s-rancher/ /var/lib/rancher
# systemctl start k3s
# systemctl start k3s-agent