CKA [Logging] – 使用Journalctl观察K8s 组件Logs

官方文档:https://kubernetes.io/docs/tasks/debug/debug-cluster/

根据官方文档我们可以看到所有组件所保存的log目录。我们可以使用journalctl 来查看log。

✅ 查看当下的node总共都多少个unit log,

journalctl -F _SYSTEMD_UNIT

✅ 查看Service log 在一个时间区间,并且最后10条记录

journalctl -u kubelet --since="2025-11-03 17:00:00" --until="2025-11-03 17:30:00" -n 10

Loading

Facebook评论