cgroups not working inside LXC containers

jbssm

Member
May 14, 2021
18
0
6
40
I am trying to get a kubernetes node to run on a LXC container (tried with Ubuntu and Alpine so far), but I can't get it to work due to a problem with the cgroups.

I am trying with a privileged LXC container, and I already configured lxc to that container at /etc/pve/lxc/200.conf with:
Code:
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.mount.auto: "proc:rw sys:rw"

Yet, I keep getting these errors:

Code:
WARN[2021-07-21T08:19:04.440391811Z] Failed to find cpuset cgroup, you may need to add "cgroup_enable=cpuset" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)
ERRO[2021-07-21T08:19:04.440400021Z] Failed to find memory cgroup, you may need to add "cgroup_memory=1 cgroup_enable=memory" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)
FATA[2021-07-21T08:19:04.440416511Z] failed to find memory cgroup, you may need to add "cgroup_memory=1 cgroup_enable=memory" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi
 
I am trying to get a kubernetes node to run on a LXC container (tried with Ubuntu and Alpine so far), but I can't get it to work due to a problem with the cgroups.
I'd suggest to run kubernetes in a Qemu VM instead of a container - it's much less of a hassle (and I doubt that the performance loss outweighs that)


Code:
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.mount.auto: "proc:rw sys:rw"
this removes almost all isolation which a container offers - that's more or less like running kubernetes directly on the host ....

If you like to try with a LXC guest - I'd start by creating an unprivileged container and enable nesting in Options->Features
 
Hi and thank you.

I was trying LXC because it's much easier to config several LXC containers than several VMs (i.e. I can just change the hostname and IP addresses directly on Proxmox interface and deploy a few of them instead of going through the install process of a full VM).

If you like to try with a LXC guest - I'd start by creating an unprivileged container and enable nesting in Options->Features

There's is no nesting option for an LXC container. Aren't you talking about a VM here?
 
  • Like
Reactions: jbssm

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!