-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Podman: "failed to find cpu cgroup (v2)" #1082
Comments
I also ran into this issue and was able to make some progress. It looks like on Fedora 36 a non-root user does not have the
For reference: Enabling CPU, CPUSET, and I/O delegation Once I enabled the
Although the initial cluster creation is successful, I noticed that the
So without giving it too much thought I recreated the cluster like so:
Seems OK but haven't dug much deeper to verify:
I hope this helps! Cheers, |
@radikaled Thanks a lot! I've been facing same issue on Oracle Linux 8 with CGroupsV2 and rootless podman. The following command helped:
It might be cool k3d manages this automatically or at least prints a hint if rootless environment is detected. |
How could a rootless environment be detected? |
Well, assuming rootless environment is defined as an environment running under non-root user on host level and container's root user is mapped to the host level (non-root) user, the check should be the user Id of the current process (on host level — the This is (modified) example how I detect root mode in my utility (C++): #include <unistd.h>
………
const auto uid = getuid();
if (uid > 0) {
// root-less mode
} else {
// root-full mode
} Running To detect the CGroupV1 vs CGroupV2 is more tricky. I have two Oracle Linux 8 systems here. Oracle Linux 8 is capable of running in both modes but the CGroup V1 is the default. The easiest way to check in what version the system currently runs is by checking mounted filesystem name: CGroup V1: [opc@ipa ~]$ stat -fc %T /sys/fs/cgroup/
tmpfs CGroup V2: [opc@sws ~]$ stat -fc %T /sys/fs/cgroup/
cgroup2fs If the result for the P.S.: Please, excuse me if I miss some crucial points here. I'm really new to this kind of stuff. |
I had the same issue on Debian 11 today on Alibaba Cloud instance. I added following lines to
and rebooted the instance from console. Now error gone and systemd service starts correctly. |
same on |
[root@localhost ~]# cat /etc/systemd/system/[email protected]/delegate.conf [admin@localhost ~]$ cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/user@$(id -u).service/cgroup.controllers [admin@localhost ~]$ stat -fc %T /sys/fs/cgroup/ [root@localhost ~]# docker logs -f k3d-k3s-default-server-0 help pls! |
if the os is redhat os like and u have the same problem , u can visite the link below |
What did you do
I followed the instructions on using rootless podman from the k3d documentation.
k3d registry create --default-network podman hive-registry
k3d cluster create --registry-use hive-registry hive
What did you expect to happen
The cluster to start.
Screenshots or terminal output
Spying on the logs from one of the 'server' containers, the last few lines are:
This machine is using cgroups v2 as far as I can see (it is the Fedora 36 default):
Which OS & Architecture
All in a fresh Fedora 36 VM.
Which version of
k3d
Which version of docker
Using podman here:
The text was updated successfully, but these errors were encountered: