1

I am trying to get kubelet logs (not the pod logs, but the actual kubelet logs) from a node using kubernetes's API. So far I've failed to find a way. Of course I can access the logs directly but this solution would be OS and Operator dependent. Any ideas?

manavellam
  • 231
  • 3
  • 9

1 Answers1

0

You could use a daemonset such as fluentd to stream kubelet logs from node to EFK stack or any other log aggregation system. This will not be OS or operator dependent because you will be using the docker image of fluentd.This is much more scalable and standard way to get logs than using a client library.

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
  • The main idea is to build a tool for k8s users to get the logs from their existing clusters for further analysis. This cluster may or may not have a Fluentd daemonset previously deployed. If I were to create the fluentd containers at the moment of getting the logs, would I have access to older logs? – manavellam Aug 26 '20 at 14:22
  • fluentd will stream the logs stored in the filesystem of the node.You will get whatever is there in the filesystem of the node – Arghya Sadhu Aug 26 '20 at 14:30