A beautiful, terminal-based Kubernetes pod log viewer built with Go and Bubble Tea.
- Multi-Context Support - View pods from multiple Kubernetes contexts simultaneously
- Interactive TUI - Clean, keyboard-driven interface with focus management
- Context Switching - Easy selection and switching between Kubernetes contexts
- Pod Listing - View detailed pod information (name, namespace, status, restarts, age, image, container, node)
- Multi-Selection - Select multiple contexts to view their pods side-by-side
- Beautiful Theming - Catppuccin Mocha color scheme with focus-aware styling
- Tab Navigation - Cycle through contexts and pod panes with Tab/Shift+Tab
- Help Mode - Press
?for keyboard shortcuts and help
See TODO.md for planned features.
- Go 1.21 or later
- kubectl configured with access to your Kubernetes clusters
- Valid kubeconfig file (default:
~/.kube/config)
# Clone the repository
git clone https://github.com/yourusername/ktails.git
cd ktails
# Build the binary
go build -o ktails cmd/test-client/main.go
# Run
./ktailsEnable debug logging to troubleshoot issues:
KTAILS_DEBUG=1 ./ktails
# Logs will be written to messages.log# Start ktails
./ktails
# It will automatically use your default kubeconfig
# Or specify a custom kubeconfig path (future feature)qorCtrl+C- Quit the application?- Toggle help screenTab- Cycle forward through panesShift+Tab- Cycle backward through panes
↑/↓- Navigate through contextsSpace- Toggle selection (select multiple contexts)Enter- Load pods for selected context(s)Esc- Clear all selections/- Filter contexts (builtin list filter)
↑/↓- Navigate through pod listj/k- Vim-style navigation (alternative to arrows)
ktails/
├── cmd/
│ └── test-client/
│ └── main.go # Entry point
├── internal/
│ ├── config/
│ │ └── config.go # Configuration management
│ ├── k8s/
│ │ └── client.go # Kubernetes client wrapper
│ └── tui/
│ ├── tui.go # Main TUI orchestration
│ ├── cmds/
│ │ └── cmds.go # Bubble Tea commands
│ ├── models/
│ │ ├── contexts.go # Context list model
│ │ ├── pods.go # Pod table model
│ │ └── table.go # Table column definitions
│ ├── msgs/
│ │ └── msgs.go # Bubble Tea messages
│ ├── styles/
│ │ └── style.go # Catppuccin theme and styles
│ └── views/
│ └── panes.go # Layout management
└── README.md
KTails follows the Elm Architecture via Bubble Tea:
- Model - Application state (contexts, pods, focus, dimensions)
- Update - State transitions based on messages (keyboard, data loading)
- View - Render the current state to the terminal
- SimpleTui - Root model managing mode, focus, and layout
- ContextsInfo - Context list with multi-select capability
- Pods - Pod table with filtering and navigation
- K8s Client - Wraps kubectl operations for context switching and pod listing
Configuration is managed via internal/config/config.go. Future features will include:
- Themes (dark/light)
- Auto-follow logs
- Max log lines
- Refresh intervals
- Recent pod history
go test ./...# Format all Go files
go fmt ./...
# Or use gofmt directly
gofmt -w .- Define the message type in
internal/tui/msgs/ - Add command in
internal/tui/cmds/ - Update model in appropriate
internal/tui/models/file - Handle message in
internal/tui/tui.goUpdate() - Update view rendering if needed
- Bubble Tea - TUI framework
- Bubbles - TUI components (table, list)
- Lip Gloss - Styling and layout
- client-go - Kubernetes client library
See TODO.md for detailed roadmap and planned features.
- Status bar with context/namespace info
- Manual refresh (r key)
- Error display panel
- Basic log viewing
- Search mode (S key)
- Auto-refresh with interval
- Sort pods by name/status/restarts
- Log filtering and search
- Log export
- Multiple log panes
- Metrics integration
- Configuration file support
Contributions are welcome! Please feel free to submit a Pull Request.
- Follow Go best practices and idioms
- Run
go fmtbefore committing - Add tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
GNU GENERAL PUBLIC LICENSE V3
- Inspired by k9s and similar Kubernetes TUI tools
- Built with the amazing Charm TUI libraries
- Uses the Catppuccin color scheme
Coming soon - Add screenshots of the TUI in action
- Verify your kubeconfig is valid:
kubectl config view - Check context access:
kubectl config get-contexts - Enable debug mode:
KTAILS_DEBUG=1 ./ktails
- Ensure you can connect to your clusters:
kubectl cluster-info - Check your kubeconfig file permissions
- Verify network connectivity to Kubernetes API servers
- Enable debug mode to see detailed logs
- Check
messages.logfor error details - Report issues on GitHub with log output
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas