k3s ctr images import to different dir

10/31/2019

I am having tar of my service specific images. I am importing it in containerd so that it will be used by k3s to deploy PODs. command used to import image's tar is-
k3s ctr images import XXX.tar

By default it loads images in /var/lib/rancher/data dir. However, I would like to load images in different directory. Anyone know, how to specify custom directory while loading images?

-- Yogesh Jilhawar
containerd
k3s
kubernetes
rancher

1 Answer

10/31/2019

I didn't find anything that may natively allow for changing this directory. This doesn't mean nothing can be done. You can always create a symlink like this:

ln -s target_path /var/lib/rancher/data

Let me know if it helped.

-- HelloWorld
Source: StackOverflow