Thursday 8 September 2022

How to tail all logs in a kubernetes cluster

 kail from the top answer is Linux and macOS only, but Stern also works on Windows.

It can do pod matching based on e.g. a regex match for the name, and then can follow the logs.

To follow ALL pods without printing any prior logs from the default namespace you would run e.g.:

stern ".*" --tail 0

For absolutely everything, incl. internal stuff happening in kube-system namespace:

stern ".*" --all-namespaces --tail 0

Alternatively you could e.g. follow all login-.* containers and get some context with

stern "login-.*" --tail 25


from: https://stackoverflow.com/questions/55977244/how-to-tail-all-logs-in-a-kubernetes-cluster/58935566#58935566

No comments:

Post a Comment