Open shoffmeister opened 3 years ago
From https://github.com/k3s-io/k3s/issues?q=is%3Aissue+is%3Aopen++rootless I cannot tell whether this is a k3s challenge or whether k3d driving k3s needs to be adapted?
Hi @shoffmeister , thanks for opening this issue! Interesting things you're doing here :wink: So there are several points to note here:
--privileged
I am rather innocently naïve (AKA ruthless) when it comes to doing interesting things 😛 It's software after all, and it's running inside a VM, to top that off even more ;)
Many thanks for the input! I will revisit this issue here once the stars have aligned on the next versions of k3s, k3d.
I have taken good note of the explicit --rootless
into k3s.
https://rancher.com/docs/k3s/latest/en/advanced/#running-k3s-with-rootless-mode-experimental now documents steps for running k3s rootless (possibly as the result of https://github.com/k3s-io/k3s/pull/4086)
Alas, I am unable to translate the stern note
Don’t try to run k3s server --rootless on a terminal, as it doesn’t enable cgroup v2 delegation. If you really need to try it on a terminal, prepend systemd-run --user -p Delegate=yes --tty to create a systemd scope.
i.e., systemd-run --user -p Delegate=yes --tty k3s server --rootless
into something that would fit into the execution environment constructed by k3d (there is no systemd inside docker)
So, in trying to make progress on this issue here, I wonder whether it is possible at all to run k3s --rootless "inside" k3d on a rootless docker?
FWIW, I have yet to look into running k3s rootless proper.
- you have to tell k3s (inside k3d) to run rootless: `--k3s-server-arg "--rootless" --k3s-agent-arg "--rootless"
I don't see --k3s-server-arg
and --k3s-agent-arg
options for k3d cluster create
. Is running in rootless Docker now supported some other way? Given that there are instructions for rootless Podman, I assumed rootless Docker would work similarly.
I'm having problems with this too.
After enabling cpu / cpuset delegation (https://rootlesscontaine.rs/getting-started/common/cgroup2/#enabling-cpu-cpuset-and-io-delegation) I launched the cluster creation with:
k3d cluster create --k3s-arg "--rootless@server:0"
I got the following message in the log:
time="2023-03-21T08:43:13Z" level=fatal msg="expected sysctl value \"net.ipv4.ip_forward\" to be \"1\", got \"0\"; try adding \"net.ipv4.ip_forward=1\" to /etc/sysctl.conf and running
sudo sysctl --system"
What did you do
Baseline:
fuse-overlayfs
viaecho '{"storage-driver": "fuse-overlayfs"}' > ~/.config/docker/daemon.json
k3d:
export USE_SUDO=false
export K3D_INSTALL_DIR=~/bin
(~/bin exists and is on the PATH)wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
(that's copy&paste)How was the cluster created?
k3d cluster create mycluster
(that's copy&paste)Problem: Command hangs after having emitted
After considerable time, it starts spewing
which is somewhat understandable given that
docker logs k3d-mycluster-server-0
is unhappy withNote: I have not tried running k3s without the k3d wrapper (yet) - i.e. neither under root nor rootless.