How to change the memlock value for pods in an RKE2 or K3s cluster
This document (000021706) is provided subject to the disclaimer at the end of this document.
Environment
RKE2
K3s
Resolution
This can be set by modifying the RKE2 systemd unit file on the node. Here is an example showing how to change the memlock value to unlimited on an RKE2 worker node:
- SSH into the node
- Run the command:
and modify the start of the file so it looks like:sudo systemctl edit rke2-agent
### Editing /etc/systemd/system/rke2-agent.service.d/override.conf ### Anything between here and the comment below will become the new contents of the file [Service] LimitMEMLOCK=infinity
- Once you save, it will create an override.conf file with the new setting under /etc/systemd/system/rke2-agent.service.d/
- run the following command to apply the changes:
sudo systemctl restart rke2-agent.service
Now any new pod running on this node will have memlock set to unlimited. Which you can verify if you exec into the pod and run ulimit -l
Notes:
- For a K3s cluster, the steps are the same except the name of the systemd unit file that needs to be modified in step #2 would be k3s-agent and the name of the service in step #4 would be k3s-agent.service.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021706
- Creation Date: 13-Feb-2025
- Modified Date:26-Mar-2025
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com