How to set container log rotation with RKE2
This document (000021045) is provided subject to the disclaimer at the end of this document.
Environment
Situation
Resolution
Two kubelet options need to be added to RKE2 config file, /etc/rancher/rke2/config.yaml
kubelet-arg: - "container-log-max-files=5" - "container-log-max-size=10Mi"
Note please adjust the values to suit your needs, for demonstration purposes the above commands used 5 log files of 10MB, allowing for 50MB of total space to be retained per container.
Additional Information
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:000021045
- Creation Date: 18-Apr-2023
- Modified Date:29-Feb-2024
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com