This message was deleted.
# rke2
a
This message was deleted.
c
Have you seen the data-dir setting? You could also just put the default path on a separate partition...
w
Mount a separate filesystem on /var/lib/rancher. This could be a partition, a separate disk, an LVM volume, or whatever.
s
@creamy-pencil-82913 Thank you for the answer! Certainly, using
--data-dir
allows us to replace
/var/lib/rancher/rke2
. I overlooked that, my apologies.
Copy code
--data-dir value, -d value                    (data) Folder to hold state (default: "/var/lib/rancher/rke2")
However, besides the
rke2
directory, there's also the
agent
directory as shown below. This might also be related. What do you think?
Copy code
# ls -la /var/lib/rancher/
total 16
drwxr-xr-x  4 root root 4096 Apr 28 01:55 .
drwxr-xr-x 51 root root 4096 Apr 28 06:16 ..
drwx------  4 root root 4096 Apr 28 02:25 agent
drwxr-xr-x  5 root root 4096 Apr 28 01:55 rke2

# ls -la /var/lib/rancher/agent/
total 20
drwx------ 4 root root 4096 Apr 28 02:25 .
drwxr-xr-x 4 root root 4096 Apr 28 01:55 ..
drwx------ 2 root root 4096 Apr 28 01:55 applied
-rw------- 1 root root 2279 Apr 28 02:25 rancher2_connection_info.json
drwxr-xr-x 2 root root 4096 Apr 28 02:25 tmp
@wooden-easter-8724 Thank you. Indeed, that's a valid approach.
c
The agent dir is for the rancher system agent, which is part of Rancher, not rke2. If you want both somewhere else then mounting storage at /var/lib/rancher is the way to go.
p
I took the approach suggested above of mounting a dedicated partition at
/var/lib/rancher
and it's worked nicely for us
s
@creamy-pencil-82913 @prehistoric-gpu-28362 I see. Thank you.
Additionally, allow me to ask one more related question. I initially believed that the running Pod containers were located under
/va/lib/rancher
, but it seems that they are not. From my investigation, it appears that containers might be under
/run/k3s/containerd
. Is this accurate? Furthermore, in many environments, is this
/run/k3s/containerd
directory typically placed on a separate disk?
w
I would expect that
/run
is tmpfs and not actually on disk. Images, container metadata, logs, and such should all be in
/var/lib/rancher/rke2/agent/containerd
.
s
@wooden-easter-8724 You're absolutely right. As you mentioned, /run/k3s/containerd is on shm (tmpfs), so it's not relevant in this context. It does seem, as you've pointed out, that the necessary data resides in /var/lib/rancher/rke2/agent/containerd:
Copy code
# ls -la /var/lib/rancher/rke2/agent/containerd 
total 656
drwx------ 16 root root   4096 Apr 28 01:50 .
drwxr-xr-x  7 root root   4096 Apr 28 01:50 ..
drwx--x--x  2 root root   4096 Apr 28 01:49 bin
-rw-r--r--  1 root root 598896 Sep 26 09:53 containerd.log
drwxr-xr-x  4 root root   4096 Apr 28 01:49 io.containerd.content.v1.content
drwxr-xr-x  4 root root   4096 Apr 28 01:50 io.containerd.grpc.v1.cri
drwx--x--x  2 root root   4096 Apr 28 01:49 io.containerd.metadata.v1.bolt
drwx--x--x  2 root root   4096 Apr 28 01:49 io.containerd.runtime.v1.linux
drwx--x--x  3 root root   4096 Apr 28 01:50 io.containerd.runtime.v2.task
drwx------  3 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.aufs
drwx------  2 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.btrfs
drwx------  3 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.fuse-overlayfs
drwx------  3 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.native
drwx------  3 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.overlayfs
drwx------  4 root root   4096 Apr 28 01:49 io.containerd.snapshotter.v1.stargz
drwx--x--x  2 root root   4096 Apr 28 01:49 lib
drwx------  2 root root   4096 Sep 26 09:30 tmpmounts