siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.39k stars 514 forks source link

Mount /sys/fs/bpf as shared (or add option to) #8883

Open CheyenneForbes opened 3 months ago

CheyenneForbes commented 3 months ago

Feature Request

Description

Getting Cilium to work on WSL2 requires following the steps here: https://wsl.dev/wslcilium/. With other distros, its simple since all you need is mount --make-shared /sys/fs/bpf but since Talos is different, that won't work. It would be awesome if it was shared by default or if we had an option to toggle it.

Why do we need to run Talos in WSL2? WSL2 is awesome for local dev/testing in cases where you would prefer not to (or not allowed to) tinker with your system and dual boot or replace windows.

I had a look at Talos' code and it would involve this file https://github.com/siderolabs/talos/blob/main/internal/pkg/mount/bpffs.go

smira commented 2 months ago

I don't quite understand the problem here. Are you running Talos on WSL and trying to start something else on top of it?

Are you running Talos in Docker on top of WSL? If that's the case, Talos inherits those mounts from the container runtime, so it should be fixed on the host (WSL).

CheyenneForbes commented 2 months ago

Hi Smira, the goal is to run Talos with Cilium CNI in Docker on top of WSL2. As mentioned in the referenced link, the only way to get Cilium to work on nodes hosted on WSL2 is to have the node (whether Talos or another distro) mount /sys/fs/bpf as shared.

specific section in the referenced documentation:

# Change the bpf mount point to a shared mount
kubectl get nodes -o custom-columns=NAME:.metadata.name --no-headers=true | xargs -I {} docker exec {} mount --make-shared /sys/fs/bpf
CheyenneForbes commented 2 months ago

@smira Hi, doing a follow up. If you have the time, could you check out the link I shared? it explains how it can't be fixed on just the host

smira commented 2 months ago

I don't have WSL, but I'm a bit lost still here. Talos doesn't mount /sys/fs/bpf in the container mode itself.

E.g. when running Docker on Linux, the fs is not mounted at all:

$ talosctl -n 10.5.0.2 cat /proc/mounts | grep bpf
<nothing>