Why doesn't 'journalctl -u kubelet -f' command get all logs?

1.8k views Asked by At

When i command

journalctl -f 

I can get below logs.

Jan 20 16:28:49 node1 kubelet[1237]: I0120 16:28:49.858522    1237 scope.go:110] "RemoveContainer" containerID="6ff68682a6151eaecce82b16ca6bbc23ce44e71aedd871e5816dec1989a6ac7d"
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.859688275+09:00" level=info msg="RemoveContainer for \"6ff68682a6151eaecce82b16ca6bbc23ce44e71aedd871e5816dec1989a6ac7d\""
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.866650422+09:00" level=info msg="RemoveContainer for \"6ff68682a6151eaecce82b16ca6bbc23ce44e71aedd871e5816dec1989a6ac7d\" returns successfully"
Jan 20 16:28:49 node1 kubelet[1237]: I0120 16:28:49.866961    1237 scope.go:110] "RemoveContainer" containerID="f205217c8ed1ca6303d9035e95584af96708d07600887d2b4254d1080389dfbd"
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.868036395+09:00" level=info msg="RemoveContainer for \"f205217c8ed1ca6303d9035e95584af96708d07600887d2b4254d1080389dfbd\""
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.872289374+09:00" level=info msg="RemoveContainer for \"f205217c8ed1ca6303d9035e95584af96708d07600887d2b4254d1080389dfbd\" returns successfully"
Jan 20 16:28:49 node1 kubelet[1237]: I0120 16:28:49.872457    1237 scope.go:110] "RemoveContainer" containerID="b517943a97621ec70c3bbf95d4e6caa9c109ceba19eb013abdfeb252682db634"
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.873342572+09:00" level=info msg="RemoveContainer for \"b517943a97621ec70c3bbf95d4e6caa9c109ceba19eb013abdfeb252682db634\""
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.877366463+09:00" level=info msg="RemoveContainer for \"b517943a97621ec70c3bbf95d4e6caa9c109ceba19eb013abdfeb252682db634\" returns successfully"
Jan 20 16:28:49 node1 containerd[1012]: time="2023-01-20T16:28:49.879261150+09:00" level=info msg="StopPodSandbox for \"b08cbdab3744ff66a176a26643e59ec6b925082af7802dc9ea8dea29b6695331\""

However, when i command with u option

journalctl -u kubelet -f

I can't get recent logs. I just can get logs 1 days before

Jan 19 03:01:32 nodekubelet[1237]: I0119 03:01:32.192834    1237 event.go:294] "Event occurred" object="kube-system/nginx-proxy-node" fieldPath="" kind="Pod" apiVersion="v1" type="Normal" reason="SandboxChanged" message="Pod sandbox changed, it will be killed and re-created."
Jan 19 03:01:32 nodekubelet[1237]: I0119 03:01:32.212913    1237 reflector.go:255] Listing and watching *v1.Service from vendor/k8s.io/client-go/informers/factory.go:134
Jan 19 03:01:32 nodekubelet[1237]: E0119 03:01:32.213013    1237 kubelet.go:2424] "Error getting node" err="node \"node\" not found"
Jan 19 03:01:32 nodekubelet[1237]: W0119 03:01:32.213540    1237 reflector.go:324] vendor/k8s.io/client-go/informers/factory.go:134: failed to list *v1.Service: Get "https://localhost:6443/api/v1/services?limit=500&resourceVersion=0": dial tcp 127.0.0.1:6443: connect: connection refused
Jan 19 03:01:32 nodekubelet[1237]: E0119 03:01:32.213598    1237 reflector.go:138] vendor/k8s.io/client-go/informers/factory.go:134: Failed to watch *v1.Service: failed to list *v1.Service: Get "https://localhost:6443/api/v1/services?limit=500&resourceVersion=0": dial tcp 127.0.0.1:6443: connect: connection refused

Why can't i get entire logs(journalctl -f) about kubelet?

What is difference between two commands?

0

There are 0 answers