kubernetes 1.7.x
kubelet store some data in /var/lib/kubelet, how can I change it to somewhere else ?
Because my /var is every small.
kubernetes 1.7.x
kubelet store some data in /var/lib/kubelet, how can I change it to somewhere else ?
Because my /var is every small.
If it should go fast and without any problems, just create a simlink to a other location with sufficent space.
As kubelet's root-directory is located at
/var/lib/kubelet
, copy the/var/lib/kubelet
content to the new desired location, for example/data/k8s/kubelet
and after rename the/var/lib/kubelet
directory tokubelet-bup
for backup purpose.Create a SymbolicLink from documentation:
$ln -s /path/to/dir /path/to/symlink
In this example, use:
$ln -s /data/k8s/kubelet /var/lib/kubelet
this should work immediatly, otherwise use
Tested on Ubuntu 18.04
for reference: https://devdojo.com/tutorials/what-is-a-symlink
Ok. I figured it out. On centos.
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
you can add
then
if your
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
is loading environment from/etc/sysconfig/kubelet
, as does mine, you can update it to include your extra args.Entire
10-kubeadm.conf
, for reference: