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

app klog

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

5 unstable releases

new 0.2.0 Nov 14, 2024
0.1.0 Oct 30, 2024
0.0.3 Sep 30, 2024
0.0.2 Jul 27, 2024
0.0.1 Jul 26, 2024

#129 in Debugging

Download history 65/week @ 2024-07-29 17/week @ 2024-09-16 38/week @ 2024-09-23 172/week @ 2024-09-30 11/week @ 2024-10-07 10/week @ 2024-10-14 119/week @ 2024-10-28 7/week @ 2024-11-04 109/week @ 2024-11-11

236 downloads per month

MIT license

22KB
320 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
-p, --pods <PODS>...                 Pods to log
-d, --deployments <DEPLOYMENTS>...   Deployments to log
    --daemonsets <DAEMONSETS>...     Daemonsets to log
    --jobs <JOBS>...                 Jobs to log
-s, --statefulsets <STATEFULSETS>... Statefulsets to log
-f, --follow                         Follow log?
-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

~70MB
~1M SLoC