Skip to content

Watching Logs of Several Pods

One thing that always bothered me was that I couldn't get the logs of several pods at once with kubectl. A simple tail -f <path-to-logfile> isn't possible. Certainly, you can use kubectl logs -f <pod-id>, but it doesn't help if you want to monitor more than one pod at a time.

This is something you really need a lot, at least if you run several instances of a pod behind a deploymentand you don't have a log viewer service like Kibana set up.

kubetail

In that case, kubetail comes to the rescue. It is a small bash script that allows you to aggregate the log files of several pods at the same time in a simple way. The script is called kubetail and is available at GitHub.

EU and German government funding logos

Funded by the European Union – NextGenerationEU.

The views and opinions expressed are solely those of the author(s) and do not necessarily reflect the views of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.