SUSE Support

Here When You Need Us

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:

  1. SSH into the node
  2. Run the command: 
    sudo systemctl edit rke2-agent
     and modify the start of the file so it looks like: 
    ### 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
     
  3. Once you save, it will create an override.conf file with the new setting under /etc/systemd/system/rke2-agent.service.d/
  4. 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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.