- Go 94.9%
- Python 2.8%
- Makefile 1.2%
- Shell 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| cmd/k1001s | ||
| docs | ||
| internal | ||
| scripts | ||
| testdata | ||
| .gitignore | ||
| CHANGELOG.md | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| README.md | ||
k1001s
A terminal UI for Kubernetes in the spirit of k9s, built with Go, client-go and Bubble Tea.
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~/.kubeis scanned, along with~/.kube/config. With$KUBECONFIGor--kubeconfig, exactly the listed files are used, like kubectl and Headlamp;~and$VARSare 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 saysdefault) are shown asdefault · <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 withadditionalPrinterColumns, 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
defaultcontexts you type the kubeconfig file name instead. A rule can bereadonlyto block mutations entirely, and--readonlyprotects everything. - Multi-context view. Mark several contexts with
spacein: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.
:helmlists Helm 3 releases (newest revision of each, likehelm list) by decoding Helm's storage Secrets, so no helm binary is needed and it updates live.enter/dshows status, revision history, user-supplied values and notes;yshows 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.
:fluxshows every Flux object (sources, kustomizations, helmreleases, notifications, image automation) in one table, likeflux get all; kind-specific columns such as URL are in wide mode. Flux tables get a SUSPENDED column,READY Falserows turn red, and suspended orUnknownones yellow.rrequests a reconcile andshift-tsuspends or resumes (resuming also reconciles, like the flux CLI); both apply to marked rows and go through the context guard.enteron a Kustomization lists its inventory (the objects it applied), whereenteropens an object as a live table with all its actions andd/ydescribe it or show its YAML;enteron a HelmRelease opens the Helm release it manages. - Fuzzy palette.
ctrl-psearches 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
