KubeCorrelate is a lightweight, single-binary Kubernetes troubleshooting CLI available through Krew. It combines container logs, Kubernetes events, configuration changes, and node-condition signals into one time-aligned terminal stream, helping operators identify likely root causes by showing logs, events, configuration changes, and node conditions on one chronological timeline without switching between multiple commands and tools.
- Features
- How it Works
- Prerequisites
- Installation
- Usage & Examples
- Testing
- Community & Contributing
- License
- Chronological Telemetry Stream: Aligns container standard output (stdout/stderr) with warning events, configuration writes, and infrastructure health notifications.
- Dynamic Pod Discovery: Automatically tracks pod lifecycles. When containers crash, recreate, or roll out during deployments, KubeCorrelate dynamically connects to the new pod watches and tears down the old ones.
- Bounded Slop Sorting Buffer: Implements a client-side 1.5s asynchronous queue that guarantees chronological event ordering, preventing logs and events from interleaving out of order due to network and API latency.
- Graceful RBAC Degradation: Designed for locked-down clusters. If node or configuration watchers are forbidden, the tool outputs a single warning and keeps monitoring the remaining signals.
- Timestamp Normalization: Injects native RFC3339 timestamps and sanitizes output formats so logs from mixed language runtimes align perfectly.
KubeCorrelate operates purely client-side using the Kubernetes API server. It starts independent watching goroutines for each type of signal, queuing incoming items into a unified sorting multiplexer:
- Kubernetes Cluster: Compatible with Kubernetes
v1.20+. - Kubeconfig: Valid credentials pointing to the target cluster (uses your active shell context or
$HOME/.kube/config).
You can install KubeCorrelate as a kubectl plugin via Krew:
kubectl krew install correlateOnce installed, invoke it using kubectl correlate.
Requires Go 1.22+ installed.
go install github.com/Dasmat13/kubecorrelate/cmd/kubecorrelate@latestDownload the compiled release binary for your platform from the Releases Page.
# Example for Linux AMD64
VERSION=v0.1.5
curl -LO "https://github.com/Dasmat13/kubecorrelate/releases/download/${VERSION}/kubecorrelate_${VERSION#v}_linux_amd64.tar.gz"
tar -xzf "kubecorrelate_${VERSION#v}_linux_amd64.tar.gz"
sudo mv kubecorrelate /usr/local/bin/Requires Go 1.22+ installed.
# Clone the repository
git clone https://github.com/Dasmat13/kubecorrelate.git
cd kubecorrelate
# Compile the binary
go build -o bin/kubecorrelate cmd/kubecorrelate/main.goWant to see KubeCorrelate debug real failures in real time? We provide a built-in simulator script that spins up a sandbox namespace with a CrashLoopBackOff, an OOMKilled pod, and a Failed Rollout.
-
Spin up the simulated incidents:
./scripts/simulate-incidents.sh
-
Watch them correlate in real time:
# Run the plugin (using the compiled binary) ./bin/kubecorrelate -n kubecorrelate-demo -
Clean up the sandbox namespace:
kubectl delete namespace kubecorrelate-demo
Usage of kubecorrelate:
-A Monitor all namespaces
-buffer-delay string chronological sorting buffer delay (e.g. 1s, 1.5s, 3s) (default "1.5s")
-filter string Case-insensitive substring filter for container logs
-f string Case-insensitive substring filter for container logs (shorthand)
-kubeconfig string Absolute path to the kubeconfig file (defaults to ~/.kube/config)
-n string Kubernetes namespace to monitor (default "default")
-l string Label selector to filter pods (e.g. app=my-app)
-p string Regex pattern to filter pod names (e.g. ^auth-.*$)
-since string Stream logs since this duration (e.g. 5m, 1h, 24h) (default "10m")
Tail logs and events for all replicas of a specific app:
# Standalone binary
kubecorrelate -l app=order-processor
# Krew plugin
kubectl correlate -l app=order-processorMonitor a rolling deployment in a specific namespace while filtering pod names:
# Standalone binary
kubecorrelate -n staging -p "^frontend-.*$" --since 30m
# Krew plugin
kubectl correlate -n staging -p "^frontend-.*$" --since 30mMonitor all pods across all namespaces matching a label:
# Standalone binary
kubecorrelate -A -l tier=backend
# Krew plugin
kubectl correlate -A -l tier=backendVerify timestamp parsing and bounded-slop sorting algorithms locally:
go test -v ./...We welcome contributions to KubeCorrelate! If you find a bug or have a feature suggestion, please open a Github issue or pull request.
Please review our Contributing Guidelines for details on our code of conduct, development patterns, and PR submission process.
KubeCorrelate is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

