Expose rootless containerd socket directories for external access#9309
Expose rootless containerd socket directories for external access#9309brandond merged 1 commit intok3s-io:masterfrom
Conversation
|
Is this something that makes sense to do? Using rootless k3s with a rootful container runtime? The entire point of rootless k3s is that the container runtime is also rootless; if you're pointing k3s at a container runtime that is running as root outside the isolated namespace, you're missing most of the advantages of running rootless. I also think that the things will be very confused about the kubelet and container runtime being in different namespaces. Are you sure this works? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #9309 +/- ##
==========================================
- Coverage 40.56% 40.49% -0.08%
==========================================
Files 154 154
Lines 16555 16569 +14
==========================================
- Hits 6716 6710 -6
- Misses 8692 8711 +19
- Partials 1147 1148 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
I’m still talking about a rootless container runtime. So I have systemd user service for rootless containerd, and I just wanted to re-use that and point k3s to use that. From a UX point of view, it’ll be nice to have parity with the rootful workflow, where you can do things like nerdctl image ls, and also use the same runtime for kubectl apply. As you point out, it can’t work in separate namespaces, and a rootless containerd cannot be managed in a separate systemd unit even with nsenter because both are waiting for each other to be healthy. So the conclusion I’ve arrived at is that with rootless k3s, you must use the embedded containerd, and we can still use off-the-shelf nerdctl if we simply expose the containerd.sock. |
Right, which is why I'm confused why you still want to expose the cri-dockerd socket? |
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
911fd5d to
5e01c60
Compare
|
@brandond I'm fine with removing the |
Proposed Changes
When installing k3s as a rootless systemd user service, it'll have better usability if regular tools like
nerdctl,ctr, andcrictlcan interact with the container runtime embedded in k3s. Due to the rootlesskit setup being embedded in the k3s binary, it's impossible to usek3s server --rootlesswith an external--container-runtime-endpointeven withnsenterbecause the embedded kubelet does a healthcheck:containerd-runtime-endpointchild_pidnot yet available).Thus, in rootless mode it's better to just leverage the embedded containerd.
Types of Changes
$XDG_RUNTIME_DIR/k3s/containerdand$XDG_RUNTIME_DIR/k3s/cri-dockerdrespectively.Verification
k3s server --rootlessctr -a "$XDG_RUNTIME_DIR/k3s/containerd/containerd.sock" -n k8s.io image lsLinked Issues
--container-runtime-endpointwith rootless k3s #9448User-Facing Change