How to enable debug logging for the rancher-system-agent
This document (000021631) is provided subject to the disclaimer at the end of this document.
Environment
Rancher 2.8.X
Rancher 2.9.X
RKE2
Situation
The Rancher System Agent is a daemon designed to run on a system and apply "plans" to the system. Rancher System Agent plays a pivotal role in automating the installation and management of RKE2 clusters. This lightweight agent simplifies operations by handling the setup and maintenance of RKE2 configuration files. The Rancher System Agent is designed to automate tasks related to Kubernetes cluster setup and lifecycle management. For RKE2, this includes the installation process and managing configuration files under /etc/rancher/rke2/config.yaml.d/.
Resolution
Enable debug during provisioning of custom clusters
1) Add the DEBUG env to the Registration command
Set DEBUG=1 when running the registration command on the Linux hosts.
curl -fL https://rancher-server/system-agent-install.sh | sudo DEBUG=1 sh -s - --server https://rancher-server --label 'cattle.io/os=linux' --token rdgvfsrk9z5jn7srbgc84zgzl4m92n9ss8jj65w5h895wc2smrhmdv --ca-checksum e68d66cfe7330df0d55f158553bd3565653e9f7b7739864a7addd2a9cae0b223 --etcd --controlplane --worker
Enable debug for running clusters
Open a SSH session into the node and modify the rancher-system-agent service configuration file. Run the command
1) systemctl edit rancher-system-agent.service
2) Add the following lines and save it.
### Editing /etc/systemd/system/rancher-system-agent.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
Environment=CATTLE_LOGLEVEL=debug
A new file will be created, override.conf, under folder /etc/systemd/system/rancher-system-agent.service.d/
root@suse01:~# ls -lart /etc/systemd/system/rancher-system-agent.service.d/override.conf
root@suse01:~# cat /etc/systemd/system/rancher-system-agent.service.d/override.conf
[Service]
Environment=CATTLE_LOGLEVEL=debug
3 ) Restart the service to apply the changes and check the debug level
systemctl restart rancher-system-agent
systemctl status rancher-system-agent
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:000021631
- Creation Date: 27-Nov-2024
- Modified Date:19-Dec-2024
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com