K9s cheat sheet
Every K9s command and shortcut on kube.how in one place: 75 in 2 sections, CLI & Launch and UI Shortcuts. Click or tap any command to copy it.
Install K9s
K9s is a terminal UI that lets you explore resources, view logs, exec into containers, and port-forward directly from the terminal.
curl -LO https://github.com/derailed/k9s/releases/latest/download/k9s_Linux_amd64.tar.gz && tar xzf k9s_Linux_amd64.tar.gz && sudo mv k9s /usr/local/bin/
Install from GitHub release tarball (Linux amd64)
curl -sS https://webinstall.dev/k9s | bash
Install via official webi script (Linux / macOS)
brew install derailed/k9s/k9s
Install via Homebrew (macOS / Linux with brew)
k9s version
Verify installation and show build info
Launch Options
Start K9s targeting a specific context, namespace, or resource. All flags can be combined.
k9s
Launch K9s with the current context
k9s --cluster <name>
Use a specific cluster from kubeconfig
k9s --command pods
Open directly on a specific resource type
k9s --context <name>
Launch using a specific kubeconfig context
k9s --insecure-skip-tls-verify
Skip TLS certificate validation for the server
k9s --kubeconfig <path>
Use a specific kubeconfig file
k9s --readonly
Launch in read-only mode (no mutations allowed)
k9s --user <name>
Use a specific user from kubeconfig
k9s -A
Launch with all namespaces visible
k9s -n <namespace>
Launch scoped to a specific namespace
Global Shortcuts
Shortcuts available in any view. Use these to navigate, search, save, and toggle K9s panels.
:
Enter command mode, type a resource name, and press Enter
:q
Quit K9s
?
Show help and full key binding reference
/
Enter filter mode and type to narrow visible rows
Ctrl+a
Show aliases view with all available resource shortcuts
Ctrl+e
Toggle the top header bar
Ctrl+g
Toggle breadcrumb trail (crumbs)
Ctrl+r
Refresh / reload the current view
Ctrl+s
Save current view output to a file
Ctrl+u
Clear the command input field
Ctrl+z
Toggle faults highlighting (shows errored resources)
Esc
Go back or clear the active filter
Table Navigation
Vim-style movement and selection within any resource table.
Backtab
Move to the previous dialog button
Ctrl+\
Clear all marks
Ctrl+b
Page up
Ctrl+f
Page down
Ctrl+Space
Mark a range of resources
g
Jump to the top of the list
h
Scroll table left
j
Move cursor down one row
k
Move cursor up one row
l
Scroll table right (opens logs instead in pod views)
Shift+g
Jump to the bottom of the list
Space
Mark the selected resource
Tab
Accept the command-mode suggestion, or move to the next dialog button
Resource Views
Jump to any resource by typing its name or short alias in command mode (press : first, then Enter).
:configmaps
ConfigMaps view
:contexts
Contexts view, switch active context
:cronjobs
CronJobs view
:daemonsets
DaemonSets view
:deployments
Deployments view
:events
Cluster events view
:ingresses
Ingresses view
:jobs
Jobs view
:namespaces
Namespaces view, switch active namespace
:nodes
Nodes view
:pods
Pods view
:pvc
PersistentVolumeClaims view
:secrets
Secrets view
:services
Services view
Resource Actions
General actions available on any selected resource row.
c
Copy resource name to clipboard
d
Describe the selected resource
e
Edit resource YAML in your editor (K9S_EDITOR, KUBE_EDITOR or EDITOR)
Enter
Drill into / open the selected resource
Shift+a
Sort table by age
Shift+n
Sort table by name
Shift+s
Sort table by status
y
View the full resource YAML
Pod Actions
Extra keys available when a pod row is selected in the pods view.
a
Attach to a running container
Ctrl+d
Delete the selected resource (confirmation dialog)
Ctrl+k
Kill the selected pod immediately, no confirmation (like kubectl delete --now)
f
Show active port-forward sessions
l
Open log viewer for the selected pod
p
Open previous (terminated) container logs
s
Shell into a container (exec -it)
Shift+f
Port-forward from the selected pod
Log View
Shortcuts inside the log viewer. Open with l on a pod.
0-6
Set the log time window (0 tail, 1 head, 2 1m, 3 5m, 4 15m, 5 30m, 6 1h)
a
Toggle logs from all containers
Ctrl+s
Save current logs to a file
f
Toggle full-screen log view
s
Toggle auto-scroll (follow new lines)
w
Toggle word wrap