Rancher 各组件开启 debug 级别日志
包括 Rancher、Rancher System Agent、Cattle Cluster Agent 等组件开启 debug 级别日志方法。
Rancher
开启 debug:
1 | kubectl -n cattle-system get pod -l app=rancher --no-headers | awk '{ print "kubectl -n cattle-system exec "$1" -c rancher -- loglevel --set debug" }' | sh |
关闭 debug:
1 | kubectl -n cattle-system get pod -l app=rancher --no-headers | awk '{ print "kubectl -n cattle-system exec "$1" -c rancher -- loglevel --set info" }' | sh |
Rancher System Agent
Rancher System Agent 是通过 systemd 方式运行在节点上的组件,需要通过传入环境变量的方式开启 debug。
开启 debug:
1 | cat > /etc/systemd/system/rancher-system-agent.env <<EOF |
关闭 debug:
1 | cat /dev/null > /etc/systemd/system/rancher-system-agent.env |
Cattle Cluster Agent
开启 debug:
1 | kubectl -n cattle-system get pod -l app=cattle-cluster-agent --no-headers | awk '{ print "kubectl -n cattle-system exec "$1" -- loglevel --set debug" }' | sh |
关闭 debug:
1 | kubectl -n cattle-system get pod -l app=cattle-cluster-agent --no-headers | awk '{ print "kubectl -n cattle-system exec "$1" -- loglevel --set info" }' | sh |
Rancher 各组件开启 debug 级别日志
https://warnerchen.github.io/2025/11/04/Rancher-各组件开启-debug-级别日志/
You need to set
install_url to use ShareThis. Please set it in _config.yml.