How do I set ulimit for containers in Kubernetes? (specifically ulimit -u)
Above all not working for me.
I done the following (it works on ubuntu:18.04 and centos/7):
sudo nano /usr/lib/systemd/system/docker.service
Added
--default-ulimit memlock=-1:-1
To line
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
This line must looks like:
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit memlock=-1:-1
And then you MUST reload rightly: firstly run command
sudo systemctl daemon-reload
And then run command
sudo systemctl restart docker.service
To check work it or not works, run command
docker run busybox:1.28 cat /proc/1/limits
You must see unlimited max lock memory like about this:
...
Max locked memory unlimited unlimited bytes
...
And elasticsearch starts to work!!!!