https://rancher.com/ logo
Title
b

boundless-eye-27124

12/19/2022, 9:32 PM
How can we set
ulimit memlock=-1:-1
in RKE2 k8s containers?
c

creamy-pencil-82913

12/19/2022, 9:45 PM
kubernetes does not allow setting ulimit values on a per-container basis
b

boundless-eye-27124

12/19/2022, 9:49 PM
How can we configure at contained level?
# ulimit -l
65536
^^ On k8s node
$ ulimit -l
64
^^ on k8s pod
@creamy-pencil-82913 I’m looking for a way to add following line in containerd service file, can you please help me to locate that file in RKE2, I couldn’t find it anywhere other than containerd tom file
[Service]
LimitMEMLOCK=67108864
c

creamy-pencil-82913

12/19/2022, 10:44 PM
by default k3s comes with an embedded containerd. there is not a separate systemd unit. You should just set the limits in the k3s systemd unit.
b

boundless-eye-27124

12/19/2022, 11:31 PM
it is possible to set from the RKE2 config.yml file?
c

creamy-pencil-82913

12/19/2022, 11:31 PM
er sorry, rke2 not k3s.
no, it must be set in the systemd unit. RKE2 does not set its own limits
b

boundless-eye-27124

12/20/2022, 10:51 PM
thanks
it was the kernel issue and I had to update the kernel to fix the original issue