#kubernetes #logs #tail #pods #multiple #tool #simultaneously

app klog

klog is a tool that allows you to tail logs of multiple Kubernetes pods simultaneously

9 releases (4 breaking)

0.4.0 Jan 15, 2025
0.3.2 Dec 30, 2024
0.2.1 Dec 4, 2024
0.2.0 Nov 14, 2024
0.0.2 Jul 27, 2024

#343 in Debugging

Download history 1/week @ 2024-10-20 114/week @ 2024-10-27 11/week @ 2024-11-03 106/week @ 2024-11-10 18/week @ 2024-11-17 1/week @ 2024-11-24 223/week @ 2024-12-01 40/week @ 2024-12-08 1/week @ 2024-12-15 111/week @ 2024-12-29 10/week @ 2025-01-05 114/week @ 2025-01-12 18/week @ 2025-01-19 4/week @ 2025-02-02

136 downloads per month

MIT license

23KB
506 lines

klog

License: MIT Rust Report Card Coverage Status

klog is a tool that allows you to tail logs of multiple Kubernetes pods simultaneously.

Installation

You can build and install klog using cargo:

# Using Cargo
cargo install klog

alternatively, grab a pre-built binary for your OS from the releases page. Curently, there are x86_64 binaries provided for Windows, MacOS and Linux.

Usage

klog will use your current sessions kubecontext.

klog [OPTIONS] --namespace <NAMESPACE> --pods <PODS>...

# Example
klog -n my-namespace -p pod1 pod2 pod3 -f

Options

-n, --namespace <NAMESPACE>           Namespace to use
-d, --deployments <DEPLOYMENTS>...    Deployment to log
-s, --statefulsets <STATEFULSETS>...  Statefulsets to log
    --daemonsets <DAEMONSETS>...      Daemonsets to log
    --jobs <JOBS>...                  Jobs to log
    --cronjobs <CRONJOBS>...          CronJobs to log
-p, --pods <PODS>...                  Pods to log
-f, --follow                          Follow log?
    --filter <FILTER>                 Filter [default: ]
-h, --help                            Print help
-V, --version                         Print version

Example

To tail logs from pods pod1, pod2, pod3 and deployment my-service in the my-namespace namespace and follow the logs, run:

klog -n my-namespace -p pod1 pod2 pod3 -d my-service --follow

Acknowledgements

  • Clap for argument parsing.
  • Kube for Kubernetes API interactions.
  • Tokio for asynchronous runtime.

Dependencies

~51–80MB
~1M SLoC