minikube: minikube 1.23: Your cgroup does not allow setting memory
Steps to reproduce the issue:
minikube start --memory=8192 --cpus 2 --kubernetes-version=v1.22.1
π minikube v1.23.2 on Ubuntu 20.04
β¨ Automatically selected the docker driver. Other choices: virtualbox, ssh
β Your cgroup does not allow setting memory.
βͺ More information: https://docs.docker.com/engine/install/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities
π Starting control plane node minikube in cluster minikube
π Pulling base image ...
π₯ Creating docker container (CPUs=2, Memory=8192MB) ...
π³ Preparing Kubernetes v1.22.1 on Docker 20.10.8 ...
βͺ Generating certificates and keys ...
βͺ Booting up control plane ...
βͺ Configuring RBAC rules ...
π Verifying Kubernetes components...
βͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
π Enabled addons: storage-provisioner, default-storageclass
π Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
- minikube 1.23.2
- docker 20.10.5
- ubuntu 20.04.2
docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
4ec4a910c4e5 minikube 14.05% 573.4MiB / 62.74GiB 0.89% 191kB / 294kB 0B / 229kB 323
As you can see, thereβs NO memory limit.
grep GRUB_CMDLINE_LINUX /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
Of course, I run sudo update-grub2 without errors and reboot the PC.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (6 by maintainers)
Hi @klaases, yes. On Ubuntu the filename is:
/sys/fs/cgroup/memory/memory.memsw.limit_in_bytesinstead of/sys/fs/cgroup/memory/memsw.limit_in_bytesThatβs why the HasMemoryCgroup check fails.@medyagh I already read that.
But If I run:
You can notice the nginx container has the limit, so itβs a minikube stuff, not docker / cgroups related.
hey @kadern0 , it looks like I still have the same issue. Here is the output:
I have ensure grub options are in place to enable setting the cgroup swap limit, and I can follow all steps shown in this blog post and they work: https://fabianlee.org/2020/01/18/docker-placing-limits-on-container-memory-using-cgroups/
Let me know if there is anything else to test.
EDIT: Iβm on Ubuntu 22.04.
AHH sorry I rushed through too fast and didnβt switch branch initiallyβ¦ I just tried with the right branch and it works:
Thanks!
Hey, I just wanted to add, that @kadern0βs fix works for me. Iβm using PopOS 22.04:
uname -a:minikube version:ls -l /sys/fs/cgroup:cat /sys/fs/cgroup/cgroup.subtree_control:with following kernel parameters (using systemd-boot):
minikube start --cpus 6 --memory 24g --kubernetes-version=v1.20.11:@vuldin, if you follow the instructions here you can build minikube yourself. You will have to use my git repo and checkout to the
issue-12842branch before running the make command.It would seem like we need to check both
/sys/fs/cgroup/memory/memory.memsw.limit_in_bytesand/sys/fs/cgroup/memory/memory.limit_in_bytes, which feels doable.