From c518027c19e449690f0504c37307c8a347fa7f2a Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Thu, 16 Nov 2023 15:30:32 +0800 Subject: [PATCH] fix(collector-longhorn): k3s cluster missing kubelet log ref: longhorn-7121 Signed-off-by: Chin-Ya Huang --- hack/collector-longhorn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/collector-longhorn b/hack/collector-longhorn index 17ea5e1c..daf0533e 100644 --- a/hack/collector-longhorn +++ b/hack/collector-longhorn @@ -35,6 +35,10 @@ function collect_kubelet_log(){ # ref. https://kubernetes.io/docs/concepts/cluster-administration/logging/#log-location-node chroot ${HOST_PATH} /usr/bin/journalctl -r -u kubelet > kubelet.log + # For K3s cluster + chroot ${HOST_PATH} /usr/bin/journalctl -r -u k3s.service > k3s-service.log + chroot ${HOST_PATH} /usr/bin/journalctl -r -u k3s-agent.service > k3s-agent-service.log + if [ -f ${RKE2_KUBELET_LOG_PATH} ]; then cp ${RKE2_KUBELET_LOG_PATH} . fi