In part 23 you made kubectl faster with kubectx, stern, krew and completion. This part covers k9s, an open source terminal UI (Apache-2.0) that shows your cluster as live tables and maps most of the kubectl commands from this series to single keys. We waited until now on purpose: when k9s shows a Pod stuck in ImagePullBackOff, you already know from parts 4 and 21 what that means and what to look at. We tested k9s v0.51.0, the latest release on 10 Nov 2026 (published 6 Jun 2026), on a kind cluster (kind v0.33.0, node v1.37.0) with the web Deployment and the busybox client from part 23. Everything shown came from our terminal unless we say it came from the k9s docs.
What you will build
You will install k9s, find its config files, walk through Pods, Deployments, logs and describe, use two overview screens (xray and pulses), add two plugins of your own, and set up read-only mode so a wrong key cannot delete anything. k9s uses the same kubeconfig and permissions as kubectl, so anything it shows or changes, kubectl could too.
k9s is for looking and for quick, one-off actions while you work. Keep using kubectl for anything you want to repeat or share: a command in a runbook, a script in CI, or a step in a pull request description is something another person can copy and review, while a sequence of key presses is not. A good habit is to find the problem in k9s, then write down the kubectl command that fixes it. The diagram in the next section helps with that, because every key we use maps to a command from an earlier part. k9s also asks the API server for fresh data every 2 seconds by default, so on a large cluster with many people watching it, raise the refresh interval with -r or the refreshRate setting.
Install k9s and find its files
Download the release archive and its checksum file from GitHub and check it:
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -sExplain this command
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -scurlA command-line HTTP client. Here it downloads a release file from GitHub.-sSLOcurl flags: silent, show errors, follow redirects, and save the file under its remote name.https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gzThe release asset URL. The lesson pins a version tag and verifies the download with a checksum before extracting it.
Explain this command
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -scurlA command-line HTTP client. Here it downloads a release file from GitHub.-sSLcurl flags: silent, show errors, follow redirects.-oWrite the download to this file instead of using the remote name.k9s-checksums.sha256The checksum file from the same GitHub release as the archive. sha256sum --check reads this file.https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256The checksum file URL from the same GitHub release. The lesson pins the same version tag as the archive.
Explain this command
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -ssha256sumPrint or check SHA-256 checksums. With --check it verifies downloaded files against a checksums file.--checkWith sha256sum, verify files against the checksums listed in the given file.--ignore-missingWith sha256sum --check, skip checksum lines for files that are not in the current directory, so one upstream checksums file can be used for a single archive.k9s-checksums.sha256The checksum file from the same GitHub release as the archive. sha256sum --check reads this file.
Explain this command
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -starCreate or extract tape archives. xzf extracts a gzip-compressed archive.xzftar flags: extract, filter through gzip, and use the following file as the archive.k9s_Linux_amd64.tar.gzThe downloaded release archive to extract.-CWith tar, change to this directory before extracting, so the binary lands in ~/.local/bin.~/.local/binA directory on a typical user PATH, used here so the installed binaries can be run without sudo.k9sThe member to extract from the archive. Passing the binary name avoids unpacking extra files such as licenses into ~/.local/bin.
Explain this command
curl -sSLO https://github.com/derailed/k9s/releases/download/v0.51.0/k9s_Linux_amd64.tar.gz
curl -sSL -o k9s-checksums.sha256 https://github.com/derailed/k9s/releases/download/v0.51.0/checksums.sha256
sha256sum --check --ignore-missing k9s-checksums.sha256
tar xzf k9s_Linux_amd64.tar.gz -C ~/.local/bin k9s
k9s version -sk9sA terminal UI over the Kubernetes API. It uses the same kubeconfig and permissions as kubectl.versionPrint the k9s version. With -s it prints a short version string.-sShort form of --short. k9s version -s prints only the version string.
k9s_Linux_amd64.tar.gz: OK
Version v0.51.0
Commit 558caafe7ba067467de46b320cc22ef11fef9c34
Date 2026-06-06T14:04:25Z
On our shared lab box we unpacked into a private directory and pointed HOME at a scratch folder, so the paths below start with /tmp/k8s22/home where yours start with your home directory. The README also lists Homebrew and other package managers. k9s info shows where everything lives:
k9s infoExplain this command
k9s infok9sA terminal UI over the Kubernetes API. It uses the same kubeconfig and permissions as kubectl.infoPrint k9s version and the paths of its config, plugin, log and cache files.
Version: v0.51.0
Config: /tmp/k8s22/home/.config/k9s/config.yaml
Custom Views: /tmp/k8s22/home/.config/k9s/views.yaml
Custom Jumps: /tmp/k8s22/home/.config/k9s/jumps.yaml
Plugins: /tmp/k8s22/home/.config/k9s/plugins.yaml
Hotkeys: /tmp/k8s22/home/.config/k9s/hotkeys.yaml
Aliases: /tmp/k8s22/home/.config/k9s/aliases.yaml
Skins: /tmp/k8s22/home/.config/k9s/skins
Context Configs: /tmp/k8s22/home/.local/share/k9s/clusters
Logs: /tmp/k8s22/home/.local/state/k9s/k9s.log
Benchmarks: /tmp/k8s22/home/.local/state/k9s/benchmarks
2026/11/10 23:40:07 ERROR Unable to reads k9s config file error="open /tmp/k8s22/home/.config/k9s/config.yaml: no such file or directory"
ScreenDumps: /tmp/k8s22/home/.local/state/k9s/screen-dumps
We trimmed the logo. The ERROR line is harmless on a fresh install: k9s writes config.yaml the first time the UI starts. After that first start, the file held these defaults (trimmed):
k9s:
refreshRate: 2
readOnly: false
portForwardAddress: localhost
shellPod:
image: busybox:1.37.0
namespace: default
logger:
tail: 100
buffer: 5000
refreshRate: 2 means the tables reload every 2 seconds, and logger.tail: 100 means the log view starts with the last 100 lines, like kubectl logs --tail=100.
Try it: move around with single keys
Every key in this walk-through stands for a kubectl command you already know from earlier parts, which is the easiest way to remember them.
- Start k9s in your namespace.
--splashlessskips the logo animation:
k9s -n k8s-from-zero --splashlessExplain this command
k9s -n k8s-from-zero --splashlessk9sA terminal UI over the Kubernetes API. It uses the same kubeconfig and permissions as kubectl.-nShort form of --namespace. If present, the namespace scope for this CLI request.k8s-from-zeroThe namespace name.--splashlessStart k9s without the splash screen.
This is the first screen we got, copied from the terminal (120 columns wide, empty rows removed):
Context: kind-k8s-ep22 [RW] <0> all <a> Attach
Cluster: kind-k8s-ep22 <1> k8s-from-zero <ctrl-d> Delete
User: kind-k8s-ep22 <2> default <d> Describe
K9s Rev: v0.51.0 <e> Edit
K8s Rev: v1.37.0 <?> Help
CPU: n/a <shift-j> Jump Owner
MEM: n/a
┌─────────────────────────────────────────────── pods(k8s-from-zero)[4] ───────────────────────────────────────────────┐
│ NAME↑ PF READY STATUS RESTARTS IP NODE AGE │
│ client ● 1/1 Running 0 10.244.1.11 k8s-ep22-worker 3m43s │
│ noshell ● 1/1 Running 0 10.244.1.10 k8s-ep22-worker 5m19s │
│ web-854c556f4-2mnfl ● 1/1 Running 0 10.244.1.13 k8s-ep22-worker 3m25s │
│ web-854c556f4-5qx6w ● 1/1 Running 0 10.244.1.12 k8s-ep22-worker 3m25s │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
<pod>
[RW]after the context name means k9s may change things.CPUandMEMshown/abecause our cluster has no metrics-server; part 25 installs it. The keys at the top change with the view; press?for the full list. Our help screen included, among many others:
│ RESOURCE GENERAL NAVIGATION
│ <0> all <ctrl-a> Aliases <j> Down
│ <1> k8s-from-zero <q> Back <shift-g> Goto Bottom
│ <a> Attach <ctrl-u> Command Clear <[> History Back
│ <ctrl-d> Delete <backtab> Field Previous <h> Left
│ <d> Describe </term> Filter mode <ctrl-f> Page Down
│ <e> Edit <?> Help <ctrl-b> Page Up
│ <ctrl-k> Kill <ctrl-space> Mark Range
│ <l> Logs <:q> Quit
│ <p> Logs Previous <ctrl-r> Reload
│ <shift-f> Port-Forward <ctrl-s> Save
│ <s> Shell <ctrl-e> Toggle Header
- Type
:to open the command prompt, then a resource name or alias.:deployand Enter switched to Deployments:
┌─────────────────────────────────────────── deployments(k8s-from-zero)[1] ────────────────────────────────────────────┐
│ NAME↑ READY UP-TO-DATE AVAILABLE AGE │
│ web 2/2 2 2 15m │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
<deployment>
- The aliases file k9s wrote on first start already maps
dptodeployments, andctrl-alists every alias. Enter on a row drills down (Deployment to its Pods), Esc goes back. Then:podsand/webfiltered the table to names that match the regular expressionweb; the title shows the filter:
┌─────────────────────────────────────────── pods(k8s-from-zero)[2] </web> ────────────────────────────────────────────┐
│ NAME↑ PF READY STATUS RESTARTS IP NODE AGE │
│ web-854c556f4-2mnfl ● 1/1 Running 0 10.244.1.13 k8s-ep22-worker 4m2s │
│ web-854c556f4-5qx6w ● 1/1 Running 0 10.244.1.12 k8s-ep22-worker 4m2s │
- With a Pod selected,
lopened its logs, following likekubectl logs -f. The keys at the top switch between tail (0), head (1) and time ranges from 1 minute (2) to 1 hour (6):
┌───────────────────────────────── Logs(k8s-from-zero/web-854c556f4-2mnfl:web)[tail] ──────────────────────────────────┐
│ Autoscroll:On ColumnLock:Off FullScreen:Off Timestamps:Off Wrap:Off │
│ 10.244.1.11 - - [10/Nov/2026:21:40:19 +0000] "GET / HTTP/1.1" 200 896 "-" "Wget" "-" │
│ 10.244.1.11 - - [10/Nov/2026:21:40:27 +0000] "GET / HTTP/1.1" 200 896 "-" "Wget" "-" │
│ 10.244.1.11 - - [10/Nov/2026:21:40:28 +0000] "GET / HTTP/1.1" 200 896 "-" "Wget" "-" │
- Esc went back, and
dshowed the same text askubectl describe pod(trimmed):
┌──────────────────────────────────── Describe(k8s-from-zero/web-854c556f4-2mnfl) ─────────────────────────────────────┐
│ Name: web-854c556f4-2mnfl │
│ Namespace: k8s-from-zero │
...
│ Node: k8s-ep22-worker/172.18.0.11 │
...
│ Labels: app.kubernetes.io/name=web │
...
│ Controlled By: ReplicaSet/web-854c556f4 │
shift-fopened the port-forward dialog, prefilled with the container port:
│ ┌──────────────<PortForward>───────────────┐
│ │ k8s-from-zero/web-854c556f4-2mnfl │
│ │ Container Port: web::80 │
│ │ Local Port: 80 │
│ │ Address: localhost │
│ │ OK Cancel │
We did not get a working forward through this dialog in our scripted terminal session: our key presses did not land on the right field, and curl on the local port got no answer. We are not claiming it works here; use kubectl port-forward from part 4 when you need a forward you can trust.
Two overview screens: xray and pulses
:xray deploy draws the ownership tree of every Deployment in the namespace, the same chain kubectl tree showed in part 23, plus each Pod’s ServiceAccount and containers:
┌───────────────────────────────────────── Xray-Deployments(k8s-from-zero)[2] ─────────────────────────────────────────┐
│ deployments(1)
│ └── k8s-from-zero(1)
│ └── web(1) [2/2/0]
│ └── k8s-from-zero(2)
│ ├── web-854c556f4-2mnfl(2) [1/1]
│ │ ├── default
│ │ └── web
│ └── web-854c556f4-5qx6w(2) [1/1]
│ ├── default
│ └── web
We removed the small icons k9s draws in front of each name. :pulses shows a dashboard with one tile per resource kind (Pods, Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, PersistentVolumes, PersistentVolumeClaims, HorizontalPodAutoscalers, Ingresses, NetworkPolicies, ServiceAccounts), each with a count, and an up arrow on the tiles that had changed. Tab moves between tiles and Enter opens that resource’s table.
Add your own plugins
A k9s plugin binds a key to a shell command for the selected row. k9s passes values such as $NAME, $NAMESPACE and $CONTEXT to the command (plugins docs). Save this as plugins.yaml in the path k9s info printed:
plugins:
owner-tree:
shortCut: Shift-T
description: Owner tree
scopes:
- deployments
command: sh
background: false
args:
- -c
- "kubectl tree deployment $NAME -n $NAMESPACE --context $CONTEXT; echo; read -p 'Enter to go back ' x"
restart:
shortCut: Shift-R
description: Rollout restart
scopes:
- deployments
command: kubectl
background: true
confirm: true
dangerous: true
args:
- rollout
- restart
- deployment/$NAME
- -n
- $NAMESPACE
- --context
- $CONTEXT
The first plugin runs the krew tree plugin from part 23 in the foreground. The second restarts a Deployment in the background, but only after you confirm. dangerous: true tells k9s to hide it in read-only mode. After restarting k9s, the Deployment view listed both: <shift-t> Owner tree and <shift-r> Rollout re (the menu cuts long names). Shift-T on web printed:
NAMESPACE NAME READY REASON STATUS AGE
k8s-from-zero Deployment/web - - 16m
k8s-from-zero ├─ReplicaSet/web-854c556f4 - - 4m47s
k8s-from-zero │ ├─Pod/web-854c556f4-2mnfl True Current 4m47s
k8s-from-zero │ └─Pod/web-854c556f4-5qx6w True Current 4m47s
k8s-from-zero └─ReplicaSet/web-86f79b74d9 - - 16m
Enter to go back
Shift-R showed the full command before running anything, and we cancelled:
│ ┌───────────<Confirm Rollout restart>────────────┐
│ │ Run? │
│ │ kubectl rollout restart deployment/web -n k8s- │
│ │ from-zero --context kind-k8s-ep22 │
│ │ Cancel OK │
Set confirm: true on every plugin that changes something. Reading the exact command before it runs is the cheapest safety check there is.
Lock it down with read-only mode
k9s can hide every action that changes the cluster. You can turn this on in three places, and a fourth layer sits outside k9s:
For one run, start k9s with --readonly:
k9s -n k8s-from-zero --splashless -c deploy --readonlyExplain this command
k9s -n k8s-from-zero --splashless -c deploy --readonlyk9sA terminal UI over the Kubernetes API. It uses the same kubeconfig and permissions as kubectl.-nShort form of --namespace. If present, the namespace scope for this CLI request.k8s-from-zeroThe namespace name.--splashlessStart k9s without the splash screen.-cShort form of --command. For k9s, the starting view, such as deploy or pods.deployThe starting view passed to -c. deploy opens the Deployments table.--readonlyStart k9s in read-only mode for this run, hiding write actions such as Delete and Edit. The lesson notes that RBAC is what actually enforces this.
Context: kind-k8s-ep22 [R] <0> all <d> Describe <shift-f> Port-F…
Cluster: kind-k8s-ep22 <1> k8s-from-zero <?> Help <z> Replica
User: kind-k8s-ep22 <2> default <shift-j> Jump Owner <f> Show Po
K9s Rev: v0.51.0 <l> Logs <w> Warp To
K8s Rev: v1.37.0 <p> Logs Previous <y> YAML
CPU: n/a <shift-t> Owner tree
The header says [R]. Compared with the same view in write mode, <ctrl-d> Delete, <e> Edit, <r> Restart and our <shift-r> plugin were gone, and pressing ctrl-d or shift-r did nothing. The safe Owner tree plugin stayed.
To make read-only the default for one cluster, edit that context’s config file. k9s creates it under the Context Configs path from k9s info, as clusters/<cluster>/<context>/config.yaml. We added one line, readOnly: true:
k9s:
cluster: kind-k8s-ep22
readOnly: true
namespace:
active: k8s-from-zero
Plain k9s then started with [R]. When you really need to change something, k9s --write overrides the setting for that run, and our header went back to [RW] with Delete, Edit and Restart in the menu again. You can also set readOnly: true in the global config.yaml to cover every cluster.
Read-only mode protects you from a wrong key in k9s. It does nothing about kubectl in another terminal, or about someone who starts k9s with --write. The real limit is RBAC (part 20): give your everyday user a read-only Role and use a separate, stronger identity when you need to make changes. The k9s README lists the minimum read permissions k9s needs, including access to metrics.k8s.io for the CPU and memory columns.
From the k9s docs, not tested here
These come from the k9s v0.51.0 README and k9scli.io. We did not run them in this lab:
- Kill without a dialog.
ctrl-kdeletes the selected resource with no confirmation, likekubectl delete --now.ctrl-dasks first. - Commands with arguments.
:pod /fredopens Pods filtered byfred,:pod app=fred,env=devfilters by labels, and:pod @ctx1switches to another context.:ctxand:nslist contexts and namespaces. - Skins. Color themes are YAML files in the skins directory; set one with
ui.skininconfig.yaml, override it per context, or use theK9S_SKINvariable. - Node shell. With the
nodeShellfeature gate set to true in a context config, the node view gets anskey that starts a shell Pod on that node. Our context config shows the gate asnodeShell: false. - Popeye.
:popeyeruns the Popeye cluster linter inside k9s.
When it goes wrong
- CPU and MEM say
n/a. There is no metrics-server, or your user cannot readmetrics.k8s.io. Part 25 installs metrics-server. - The table is empty. Check the namespace in the title. Press
0for all namespaces, or:nsto pick one. - Delete or Edit is missing from the menu. The header probably shows
[R]. Check the flags you started with and the readOnly setting in both config files. - A plugin does not appear. Check that
scopeslists the resource you are viewing, and that itsshortCutdoes not clash with a built-in key. A plugin withdangerous: trueis hidden in read-only mode. - The log view starts with only the last 100 lines. That is
logger.tailinconfig.yaml; raise it, or press2to6in the log view for a time range.
Cheat sheet
| Task | Command or field | Note |
|---|---|---|
| Start in a namespace | k9s -n k8s-from-zero |
-c deploy opens another view |
| Help for this view | ? |
keys change per view |
| Switch resource | :deploy, :pods, :svc |
ctrl-a lists aliases |
| All namespaces | 0 |
1, 2 are favourites |
| Filter by name | /web |
regex, Esc clears |
| Filter by label | /-l app.kubernetes.io/name=web |
from the README |
| Describe | d |
kubectl describe |
| YAML | y |
kubectl get -o yaml |
| Logs | l |
p for the previous container |
| Shell into a container | s |
kubectl exec -it |
| Ownership tree | :xray deploy |
kubectl tree |
| Dashboard | :pulses |
Tab between tiles |
| Delete | ctrl-d |
asks first; ctrl-k does not |
| Read-only for one run | k9s --readonly |
header shows [R] |
| Read-only per cluster | readOnly: true in the context config |
--write overrides |
| Your own key | plugins.yaml with confirm: true |
dangerous: true hides it in read-only |
| Find config files | k9s info |
paths follow XDG directories |
| Quit | :q |
or ctrl-c |
Recap
- k9s is a live, keyboard-driven view over the same API and permissions kubectl uses.
:switches resources,/filters, andd,l,yandsmatch describe, logs, YAML and exec.:xrayshows ownership trees, and:pulsesgives a quick count per resource kind.- Plugins turn your own commands into keys; use
confirm: trueanddangerous: truefor anything that writes. - Read-only mode in the context config is a good default for shared clusters, and RBAC is what actually enforces it.
Command explanations and quoted passages in this lesson come from or adapt the kubectl reference and the Kubernetes documentation, © The Kubernetes Authors, licensed under CC BY 4.0. We shortened and edited some passages. Kubernetes® is a registered trademark of The Linux Foundation. aitamer.news is not affiliated with or endorsed by The Linux Foundation or the CNCF.

The Campfire
CommentsThanks. Your comment is waiting for the desk. Once it is approved it appears here within about a minute.
Add a comment