How bisman-singh/kubectl-timeline works
kubectl-timeline is an agentless Kubernetes incident-timeline CLI. Its main workflow reads live cluster state, reconstructs and filters a chronological timeline, correlates incidents into root-cause chains, then renders detailed or namespace-summary output. Correlation includes documented pattern detection, cascade grouping, deduplication, and confidence ranking. The collector and main execution path are shown in excerpts; broader correlation features are represented from README documentation, not independently verified in source.
Main entry points: main.go CLI workflow · correlator.go Chain analysis · format.go Format renderers · types.go Timeline entries
Components 15
Cluster collection
- Cluster collector
pkg/collector/collector.go - Cluster snapshot
pkg/collector/types.go - Kubernetes API
Timeline reconstruction
- Timeline builder
pkg/timeline/build.go - Timeline entries
pkg/timeline/types.go - Timeline filters
pkg/timeline/types.go
Incident analysis
- Chain analysis
pkg/correlator/correlator.go - Correlation patterns
pkg/correlator/correlator.go - Dedup and cascades
pkg/correlator/correlator.go - Confidence ranking
pkg/correlator/score.go
Results and presentation
- Format renderers
pkg/output/format.go - Affected resources
pkg/output/format.go - Namespace summary
pkg/output/format.go
Other components
- Operator
- CLI workflow
cmd/kubectl-timeline/main.go
Connections 20
- Operator → CLI workflow: runs command
cmd/kubectl-timeline/main.go - CLI workflow → Cluster collector: collects state
cmd/kubectl-timeline/main.go - Cluster collector → Kubernetes API: lists resources
pkg/collector/collector.go - Cluster collector → Cluster snapshot: builds snapshot
pkg/collector/collector.go - CLI workflow → Timeline builder: builds timeline
cmd/kubectl-timeline/main.go - Timeline builder → Cluster snapshot: reads snapshot
pkg/timeline/build.go - Timeline builder → Timeline entries: creates entries
pkg/timeline/build.go - CLI workflow → Timeline filters: filters entries
cmd/kubectl-timeline/main.go - Timeline filters → Timeline entries: updates entries
pkg/timeline/types.go - CLI workflow → Chain analysis: analyzes timeline
cmd/kubectl-timeline/main.go - Chain analysis → Timeline entries: analyzes entries
pkg/correlator/correlator.go - Chain analysis → Cluster snapshot: uses cluster state
pkg/correlator/correlator.go - Chain analysis → Correlation patterns: detects patterns
README.md - Chain analysis → Dedup and cascades: merges chains
pkg/correlator/correlator.go - Chain analysis → Confidence ranking: ranks confidence
- CLI workflow → Format renderers: renders results
cmd/kubectl-timeline/main.go - Format renderers → Affected resources: summarizes resources
pkg/output/format.go - CLI workflow → Namespace summary: renders summary
cmd/kubectl-timeline/main.go - Format renderers → Timeline entries: formats timeline
pkg/output/format.go - Format renderers → Chain analysis: formats chains
pkg/output/format.go