ktop User Guide¶
What is ktop?¶
ktop is a terminal-based monitoring tool for Kubernetes clusters, similar to the Unix top command. It provides a real-time view of your cluster's nodes, pods, and containers with resource usage metrics.
Unlike kubectl top, which shows a static snapshot, ktop continuously updates and allows you to drill down from cluster overview to individual container logs—all from a single terminal interface.
Prerequisites¶
- Kubernetes cluster access - A running cluster you can connect to
- kubeconfig file - Valid credentials (typically at
~/.kube/config) - Optional: Metrics infrastructure - Metrics-Server instance running on the cluster or accessible kubelet/cAdvisor endpoints for resource usage data
Installation¶
kubectl plugin¶
# Install krew if not present: https://krew.sigs.k8s.io/docs/user-guide/setup/install/
kubectl krew install ktop
kubectl ktop
Homebrew (macOS/Linux)¶
Docker¶
export KUBECONFIG=$HOME/.kube/config
docker run --network=host --rm -it \
-v $KUBECONFIG:/config \
-e KUBECONFIG=/config \
-e TERM=xterm-256color \
ghcr.io/vladimirvivien/ktop:latest
Go install¶
Binary download¶
Download prebuilt binary archives for Linux, macOS, and Windows (.zip and .tar.gz) from GitHub Releases and add the binary to your PATH.
Build from source¶
The project also includes a cross-platform build script:
Running ktop¶
Basic usage:
ktop uses your kubeconfig file (from $KUBECONFIG or ~/.kube/config) to connect. Override settings with flags:
# Use specific context
ktop --context my-cluster
# Filter to a namespace
ktop --namespace production
# Combine options
ktop --context staging --namespace default --metrics-source=prometheus
Metrics Sources¶
ktop supports three metrics sources. It automatically falls back through them if the preferred source is unavailable.
| Source | Description |
|---|---|
prometheus |
Scrapes metrics directly from kubelet/cAdvisor |
metrics-server |
Uses Kubernetes Metrics Server API |
none |
No metrics collection, requests/limits only |
Automatic Fallback¶
When you run ktop without specifying a source, it tries:
1. prometheus - If RBAC permits access to node metrics endpoints
2. metrics-server - If Metrics Server is available on the cluster
3. none - Shows resource requests/limits instead of usage
Prometheus Mode¶
Prometheus mode scrapes metrics directly from Kubernetes components, providing richer data including network and disk I/O.
Requirements:
- RBAC permissions to access /metrics endpoints on nodes
- Not available in most managed Kubernetes services (control plane is inaccessible)
Apply RBAC permissions:
kubectl apply -f https://raw.githubusercontent.com/vladimirvivien/ktop/main/hack/deploy/rbac-prometheus.yaml
Metrics Server Mode¶
Works with the standard Kubernetes Metrics Server:
This is the most compatible option for managed Kubernetes services.
Navigation¶
ktop organizes cluster inspection into five primary tabs ([1]–[5]), paired with in-place drill-down pages and elevated ModalBox overlays:
Switch top-level tabs at any time using 1–5 or < / >. Launch directly onto a specific page with --page=overview, --page=workloads, --page=storage, --page=network, --page=events, or ui.default_page in ~/.ktop/config.yaml.
Key Controls¶
| Key | Action |
|---|---|
| 1–5 / < / > | Switch between [1] Overview, [2] Workloads, [3] Storage, [4] Network, and [5] Events |
| Tab / Shift+Tab | Cycle focus between header, tables, and detail sections (restores any expanded panel first) |
| Enter | Drill down into the selected Node, Pod, Workload, Container, or Event |
| v | Inspect full resource YAML inside a floating scrollable modal (y copies YAML to clipboard) |
| ← / → (h / l) | Switch columns on 3-column detail cards (System Detail, Pod Detail, Container Detail) |
| ↑ / ↓ (j / k) | Navigate table rows, modal lists, or scroll within the active detail column |
| x | Expand or restore any focused table, detail card, or container log view to full workspace height |
| ? / F1 | Toggle the context-sensitive keyboard shortcuts modal |
| y / Y | Copy selected resource name (or YAML / event details inside overlays) to clipboard |
| = | Open column customization dialog to toggle visible columns |
| / | Filter focused table rows by text (or filter namespace when Header is focused) |
| ESC | Close modal, clear filter, restore expanded panel, return to previous view, or double-ESC quit |
| Ctrl+C | Quit immediately |
Selection Memory & Tips¶
- Identity-based selection memory: Moving focus between panels or returning from a drill-down view remembers the last selected row by resource identity rather than resetting the cursor to row 0. First-time focus initializes cleanly on the first row.
- Dimmed modal backdrops: Opening Pod Inspector, YAML viewer, Help (
?), or Event Detail modals renders an elevatedModalBoxover a dimmed header and workspace while keeping the bottom shortcut footer bright and legible. - Contextual footer: The bottom bar updates automatically with keys for the active tab, modal, detail card, or log viewer.
- Sorting: Column headers underline a shortcut letter (such as
nName,cCPU,mMemory,lStall); press the key to sort ascending/descending. - Graceful telemetry degradation: When metrics endpoints are unreachable (
metrics-serverwithout PSI/Net/Disk or--metrics-source=none), all five tabs stay navigable, showingunavailableindicators where stream counters do not apply.
Pages¶
Overview ([1])¶
Overview presents cluster-wide health and resource consumption at a glance, combining the Cluster Summary dashboard (Health %, Uptime, node/pod/storage counts, CPU, MEM, Net, Disk sparklines, Stall, SLIs, KSM), the Nodes table, and the Pods table.

Select any Node or Pod and press Enter to open its detail view, or press v on any row to inspect its live YAML manifest.
Workloads ([2])¶
Workloads groups controllers into four equal-quadrant, filterable panels beneath a single-line Summary rollup bar: Deployments, StatefulSets, DaemonSets, and Jobs.

Each workload CPU and MEM column aggregates live usage across its active owned pods. Press Tab to step through quadrants, x to expand the focused table, and Enter to open Workload Detail. Inside Workload Detail, initial focus lands on Owned Pods so you can inspect replica pods with Enter, or Tab to the workload card and press v for YAML.
Storage ([3])¶
Storage tracks cluster volume capacity and I/O in a Summary bar (PVCs, PVs, Classes, total allocated/used capacity, Disk I/O) above equal 1:1 tables for 🗄 PersistentVolumeClaims and 💿 PersistentVolumes.

Use Fill% and Inodes% (when Prometheus kubelet volume metrics are active) to spot volumes approaching saturation, press x to expand either table, or press v to inspect claim/volume specs in YAML.
Network ([4])¶
Network summarizes service endpoints and ingress routing above equal 1:1 tables for Services and Ingresses, flagging zero-endpoint Services and displaying cluster-wide RX / TX rates, packet drops (Drops), and interface errors (Errs).

[4] Network reads cluster RX and TX rates from the same shared atomic cache as [1] Overview, so aggregate network throughput stays consistent across both tabs.
Events ([5])¶
Events streams Kubernetes Normal and Warning events cluster-wide or scoped to the active namespace (LAST SEEN, TYPE, REASON, OBJECT, NS, COUNT, MESSAGE), with a top Summary bar showing counts, top firing reason, and stream mode ([ALL · LIVE]).

Controls:
- w — Toggle Warnings only vs. all events
- f — Toggle Follow (LIVE) vs. Paused
- / — Filter across type, reason, object, namespace, source, and message
- y — Copy selected event summary to clipboard
- Enter — Open the floating Event Detail overlay (g jumps to the involved Pod, Node, or Workload; v views Event YAML)
Node Detail¶
Node Detail displays node summary telemetry (CPU, MEM, Net, Disk, PSI) alongside the uniform 3-column System Detail card (System, Conditions/Events, Labels/Annotations) and the Pods table for pods scheduled on that node.

Use Tab to move between Pods and System Detail. On System Detail, press ←/→ (h/l) to switch active columns, ↑/↓ (j/k) to scroll long lists, x to expand the 3-column detail card to full height (x again to restore), and Enter or v to inspect the Node YAML manifest.
Pod Detail & Floating Overlays¶
Pressing Enter on a Pod from Overview, Node Detail, or Workload Detail opens the Pod Inspector inside an elevated ModalBox frame over a dimmed workspace background, combining Pod metrics sparklines, PSI and CPU throttling (CFS) gauges, the uniform 3-column Pod Detail card (Pod Info, Conditions/Resources, Labels/Annotations), and the Containers table.

Press Enter or l on any container row to enter Container Detail and streaming logs, n to jump to the host node, x to expand either Pod Detail or Containers, v for Pod YAML, or ESC to close the modal.
Container Detail¶
Container Detail displays container configuration, images, ports, probes, and limits inside an expandable 3-column Container Detail card paired with live streaming container logs.
Log & Detail controls:
- s — Toggle log streaming on/off
- t — Toggle log timestamps
- w — Toggle line wrap
- m — Load 100 older log lines
- x — Expand focused logs or Container Detail card to full screen
- / — Filter logs (grep-style)
- g / G — Jump to top or bottom of logs
- ← / → (h / l) — Switch active column on the Container Detail card
Press ESC to close active log filters first, then return to Pod Detail.
Configuration & Session Logs¶
ktop stores user configuration and diagnostic logs under ~/.ktop/:
~/.ktop/config.yaml— Declarative defaults for metrics sources, visible columns, default page, and terminal themes.~/.ktop/ktop.log— Automatic rotating diagnostic session log (retains up to 5 archive files at 10MB each).
Troubleshooting¶
"prometheus source failed" / Falls back to metrics-server¶
Your user doesn't have RBAC permissions to access node metrics endpoints. Either:
- Apply the RBAC manifest: kubectl apply -f https://raw.githubusercontent.com/vladimirvivien/ktop/main/hack/deploy/rbac-prometheus.yaml
- Use metrics-server mode: ktop --metrics-source=metrics-server
"Terminal too small"¶
ktop requires at least 31 rows. Resize your terminal or use a larger font.
Metrics show as "-" or "n/a"¶
- If using
--metrics-source=none, this is expected (shows requests/limits only) - If using prometheus/metrics-server, check that your metrics infrastructure is running:
Permission errors¶
Ensure your kubeconfig user has access to nodes, pods, events, and metrics resources. Common minimum permissions:
- get, list, watch on nodes, pods, events
- get on nodes/proxy (for prometheus mode)