K9s is a terminal UI for Kubernetes. It talks to the cluster using your current kubeconfig (same as kubectl).
Official installation guide: Install
Prerequisites#
- A working
kubectlcontext (kubectl cluster-infoshould succeed) - A terminal that supports 256 colors (on Unix,
TERM=xterm-256coloris typical) - For in-app edits, set
EDITORorKUBE_EDITORto your preferred editor
export TERM=xterm-256color
export KUBE_EDITOR="${KUBE_EDITOR:-vim}"Installation#
For macOS, Windows, and other install options (MacPorts, Chocolatey, Scoop, tarball layout details, building from source), follow the official installation guide.
Linux#
Arch Linux:
pacman -S k9sHomebrew on Linux:
brew install derailed/k9s/k9sOther distributions: download a release tarball for your architecture from GitHub releases, extract it, and place the k9s binary on your PATH.
Run#
k9sK9s uses the current context from kubeconfig. There is no separate “command line” in the traditional sense: you work through colon commands (:), shortcuts, and key bindings.
1. Resource navigation (:)#
Type : to enter command mode, then a resource alias.
Core workloads#
| Command | Resource |
|---|---|
:pods, :po | Pods |
:deployments, :deploy, :dp | Deployments |
:services, :svc | Services |
:statefulsets, :sts | StatefulSets |
:daemonsets, :ds | DaemonSets |
:replicasets, :rs | ReplicaSets |
:jobs | Jobs |
:cronjobs, :cj | CronJobs |
Cluster and infrastructure#
| Command | Resource |
|---|---|
:nodes, :no | Nodes |
:namespaces, :ns | Namespaces |
:events | Events |
:contexts, :ctx | kubeconfig contexts |
:crd | CustomResourceDefinitions |
:metrics | Resource usage (requires metrics-server or equivalent) |
Storage#
| Command | Resource |
|---|---|
:pv | PersistentVolumes |
:pvc | PersistentVolumeClaims |
:sc | StorageClasses |
Config and secrets#
| Command | Resource |
|---|---|
:configmaps, :cm | ConfigMaps |
:secrets, :sec | Secrets |
Ingress and networking#
| Command | Resource |
|---|---|
:ingresses, :ing | Ingress |
:networkpolicies, :netpol | NetworkPolicies |
2. Search and filtering#
| Key | Action |
|---|---|
/ | Filter rows in the current view |
n | Namespace selector |
: | Command mode (jump to a resource view) |
Example: type /nginx to narrow the list to resources whose visible text matches nginx.
3. Navigation#
| Key | Action |
|---|---|
Enter | Drill into the selected resource (for example pod → containers) |
Esc | Go back |
q | Leave the current view |
Ctrl+C | Exit K9s |
4. Actions on a resource#
Bindings can vary slightly by view; the help screen (?) is authoritative for the active context.
| Key | Typical action |
|---|---|
d | Describe |
y | YAML |
e | Edit |
l | Logs |
s | Shell (exec into container) |
f | Log follow |
Ctrl+D | Delete |
Shift+F | Port forward |
5. Context and namespace#
| Command | Action |
|---|---|
:ctx | Switch kube context |
:ns | Switch namespace |
6. Metrics and sorting#
- Open a resource with
:as usual. Shift+Stoggles or cycles sort modes depending on the view.- When metrics are available, you can often sort by CPU or memory from the table headers / sort UI for that view.
7. Global shortcuts#
| Key | Action |
|---|---|
? | Help (all bindings for the current view) |
: | Command mode |
/ | Filter |
Ctrl+A | First row |
Ctrl+E | Last row |
g | Top of list (many views) |
G | Bottom of list |
8. Example debugging flow#
:ns— pick a namespace:po— list pods/crash— filter to suspicious names or statusesEnter— open the podl— logsd— describes— exec shelly— inspect YAML