klog

Crates.ioklog
lib.rsklog
version0.5.1
created_at2024-07-26 06:15:39.974022+00
updated_at2025-09-21 06:20:30.887961+00
descriptionklog is a tool that allows you to tail logs of multiple Kubernetes pods simultaneously.
homepage
repositoryhttps://github.com/tobifroe/klog
max_upload_size
id1315834
size88,160
Tobias Frölich (tobifroe)

documentation

README

klog

License: MIT Coverage Status

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

Installation

Cargo

You can build and install klog using cargo:

# Using Cargo
cargo install klog

Homebrew

brew tap tobifroe/homewbrew-klog
brew install klog

Nix

Klog is packaged in nixpkgs.

nix-shell -p klog-rs

Manual installation

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.
Commit count: 256

cargo fmt