containerd.sock in Rootless K3s #5786
Replies: 1 comment 1 reply
-
Great questions! I have no experience with k3s-rootless, but you got me curious. Where is the containerd.sock?* K3s does some linux-namespace shenanigans. I am not very experienced with namespaces and cgroups, but I was able to figure this out: After starting
You can also see the cgroups here. Let's ignore them for now, because we are actually interested in the From the output we can see that the "Main PID" is
The Let's call
Now we learned that the "exe"-process with the PID 8941 uses the same mnt-namespace as the containerd child process, so there is no need to search for the PID of Now let's use the PID
There it is! How can I import my custom container images to containerd using K3s rootless? Actually,
This means that I can reference this socket directly when using
You can probably use Where is the images registry in K3s rootless?* I don't know if I understand this question. To the best of my knowledge, K3s does not include an image registry. And how can I set a private one in K3s rootless? Again, I may misunderstand this question. But maybe this helps anyway: You can actually deploy a private registry inside your local k3s cluster!
You can copy images to this registry. I recommend https://github.com/containers/skopeo
Use can then deploy the pushed images:
Neat! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have been trying to implement K3s Rootless, my configuration is just one node where I will have all my containers running in different pods, in the normal K3s I know that I can import my custom images using
ctr images import
and also I can list them usingctr images list
, but with K3s Rootless I can't use these commands, I am getting an error that it can't find containerd.sock.So, my questions are:
/var/run/k3s/
location does not exists with rootless k3s.Have a nice day,
-Leonardo R.
Beta Was this translation helpful? Give feedback.
All reactions