No description
  • Go 94.9%
  • Python 2.8%
  • Makefile 1.2%
  • Shell 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bojan Rogalo ca9b9823f8
All checks were successful
ci / check (push) Successful in 4m9s
release / release (push) Successful in 9m6s
Add a changelog for v0.2.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 09:12:43 +01:00
.forgejo/workflows Add Forgejo workflows for CI and tag releases 2026-11-19 07:23:47 +01:00
cmd/k1001s Stamp the version from git tags and add a dist target 2026-11-19 07:19:27 +01:00
docs Add CPU/memory metrics columns and a README screenshot 2026-11-17 17:20:37 +01:00
internal Cut table CPU under watch churn from 78% to 13% of a core 2026-11-21 09:09:53 +01:00
scripts Add a colima benchmark that compares k1001s with k9s 2026-11-21 09:03:05 +01:00
testdata Add CPU/memory metrics columns and a README screenshot 2026-11-17 17:20:37 +01:00
.gitignore Stamp the version from git tags and add a dist target 2026-11-19 07:19:27 +01:00
CHANGELOG.md Add a changelog for v0.2.1 2026-11-21 09:12:43 +01:00
go.mod Theme the UI by season and blend it into the terminal background 2026-11-17 18:43:32 +01:00
go.sum Initial k1001s: a k9s-style Kubernetes TUI in Go and Bubble Tea 2026-11-17 17:05:55 +01:00
Makefile Add a colima benchmark that compares k1001s with k9s 2026-11-21 09:03:05 +01:00
README.md Add a colima benchmark that compares k1001s with k9s 2026-11-21 09:03:05 +01:00

k1001s

A terminal UI for Kubernetes in the spirit of k9s, built with Go, client-go and Bubble Tea.

k1001s showing pods across all namespaces, sorted by CPU

make install                     # builds and installs to $(brew --prefix)/bin (or PREFIX=~/.local)
k1001s                           # the context picker (or current-context of an exported $KUBECONFIG)
k1001s --context colima -n kube-system deploy
k1001s pods @dev,staging         # the same table across two clusters
k1001s --list-contexts           # what was discovered, and which contexts are protected

# a curated set, like `open -a Headlamp --env KUBECONFIG=…` (only these files, no scan)
KUBECONFIG=~/.kube/exanio-genesis-prod:~/.kube/exanio-genesis-test k1001s   # opens its current-context
k1001s --kubeconfig ~/.kube/a:~/.kube/b pods -A @all   # every cluster of the set in one table

What's different from k9s

  • Kubeconfig discovery. Without $KUBECONFIG, every file in ~/.kube is scanned, along with ~/.kube/config. With $KUBECONFIG or --kubeconfig, exactly the listed files are used, like kubectl and Headlamp; ~ and $VARS are expanded inside the list, and missing files are reported. Contexts are never merged: one file per cluster works as-is, and duplicate names (k3s always says default) are shown as default · <file>. kubectl hand-offs always get --kubeconfig <file> --context <name>.
  • Server-side tables. Lists use the API server's Table rendering, the same as kubectl get. Every kind, including CRDs with additionalPrinterColumns, gets the right columns without per-kind code. Tables are list+watch streams, and the AGE column ticks locally.
  • Prod guard. Contexts matching a protected pattern get a red header. Mutations there (delete, scale, restart, edit, shell, port-forward) require typing the context name; for generic default contexts you type the kubeconfig file name instead. A rule can be readonly to block mutations entirely, and --readonly protects everything.
  • Multi-context view. Mark several contexts with space in :ctx, or run :pods @a,b. One table then streams from all of them, with a CONTEXT column, and every action goes to the row's own cluster under that cluster's guard.
  • Metrics. Pod and node tables get CPU, MEM and %-of-request (or %-of-allocatable) columns from metrics-server, refreshed every 15s. In wide mode pods also get %-of-limit. The columns stay hidden when the metrics API isn't available.
  • Helm releases. :helm lists Helm 3 releases (newest revision of each, like helm list) by decoding Helm's storage Secrets, so no helm binary is needed and it updates live. enter/d shows status, revision history, user-supplied values and notes; y shows the rendered manifest. The view is read-only, and needs permission to list Secrets. Releases stored with the ConfigMap or SQL driver aren't shown.
  • Flux. :flux shows every Flux object (sources, kustomizations, helmreleases, notifications, image automation) in one table, like flux get all; kind-specific columns such as URL are in wide mode. Flux tables get a SUSPENDED column, READY False rows turn red, and suspended or Unknown ones yellow. r requests a reconcile and shift-t suspends or resumes (resuming also reconciles, like the flux CLI); both apply to marked rows and go through the context guard. enter on a Kustomization lists its inventory (the objects it applied), where enter opens an object as a live table with all its actions and d/y describe it or show its YAML; enter on a HelmRelease opens the Helm release it manages.
  • Fuzzy palette. ctrl-p searches resource kinds, contexts, namespaces and loaded objects at once.

Keys

:pods, :deploy kube-system, :wg -A, :svc @a,b, :pods @all, :helm, :flux, :ctx, :ns, :pf, :q commands (tab completes)
/text, /!text, /-l app=web filter, negated filter, label filter
enter drill down (workload → pods, pod → containers, CRD → instances, namespace → switch, Kustomization → inventory, HelmRelease → Helm release)
d y e describe, YAML, edit (kubectl edit)
l s shift-f logs, shell (kubectl exec), port-forward
s r scale, rollout restart (workloads)
r shift-t reconcile, suspend/resume (Flux objects)
ctrl-d ctrl-k delete, kill (grace period 0)
space mark rows; actions apply to every marked row
shift-n/a/s/r, o/O sort by name/age/status/restarts, cycle/reverse the sort column
shift-c/m sort by CPU / memory
ctrl-g multi-context tables: group rows by context (default) or sort across all contexts
ctrl-w, 0 wide columns, all namespaces
logs: f p t w c follow, previous, timestamps, wrap, cycle container
ctrl-p, ?, esc palette, help, back

Configuration

~/.config/k1001s/config.yaml (or $K1001S_CONFIG_DIR):

scanDirs: ["~/.kube"]
protected:
  - {pattern: "*prod*", mode: confirm}   # matched against context, cluster and file name
  - {pattern: "bank-*", mode: readonly}
logTail: 200
season: auto        # logo colors: auto | southern | spring | summer | autumn | winter | off

The UI accents (titles, headers, key hints, selection) follow the season palette too, and the selection is blended into the terminal's real background, which is detected via OSC 11. If detection fails, set K1001S_THEME=dark or light, and K1001S_BACKGROUND=#rrggbb.

The starting context is never remembered. With $KUBECONFIG exported (or --kubeconfig), k1001s opens that list's current-context, picked like kubectl does: from the first listed file that sets one. Otherwise it shows the context picker, unless only one context exists; --context overrides both. state.json in the same directory remembers the namespace for each context and the last view. While the TUI runs, stderr (for example, exec credential plugin output) goes to k1001s.log there.

Development

make help                   # all targets
make check                  # vet, race tests, gofmt
colima start --kubernetes && make seed
make run ARGS="--context colima -n k1001s-demo"
make screenshot             # regenerate docs/screenshot.png (tmux + rsvg-convert)
make bench                  # startup, update latency, CPU and memory vs k9s on colima