How to increase log verbosity for kubelet and kube-apiserver in RKE2
This document (000021568) is provided subject to the disclaimer at the end of this document.
Environment
Situation
When troubleshooting an issue with an RKE2 Imported or Rancher provisioned RKE2 Kubernetes cluster, it may be helpful to increase the verbosity of logging on one or more of the Kubernetes components above the default level. This article details the process of increasing log verbosity for kubelet, kube-apiserver, kube-controller-manager and kube-scheduler.
Resolution
Here’s how you can change the log verbosity for different kubernetes components:
1] For Imported type of cluster:
Edit the RKE2 Configuration File :
For RKE2 clusters, you can adjust the kube-apiserver, kube-controller-manager, kube-scheduler and kubelet flags through the configuration file located at /etc/rancher/rke2/config.yaml.
kube-apiserver-arg:
- v=8
kube-controller-manager-arg:
- v=8
kube-scheduler-arg
- v=8
kubelet-arg
- v=8
Restart RKE2 server Service:
After modifying the configuration file, restart the RKE2 or K3s service to apply the changes.
sudo systemctl restart rke2-server
2] For Rancher Provisioned clusters:
Go to Rancher UI ☰ > Cluster Management > Downstream cluster > Click on edit config > Under Cluster Configuration, click on Advanced and add/adjust the ‘v’ (ie. v=8)flag and save the configuration.
OR
Go to Rancher UI ☰ > Cluster Management > Downstream cluster > Click on edit yaml > Under spec.rkeConfig.machineGlobalConfig AND spec.rkeConfig.machineSelectorConfig adjust the verbosity, see below example:
spec:
rkeConfig:
machineGlobalConfig:
kube-apiserver-arg:
- v=8
kube-controller-manager-arg:
- v=8
kube-scheduler-arg:
- v=8
machineSelectorConfig:
- config:
kubelet-arg:
- v=8
Status
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:000021568
- Creation Date: 24-Sep-2024
- Modified Date:05-Dec-2024
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com