Loading...
Cheat sheet
Keyboard shortcuts, resource commands, and configuration for the k9s Kubernetes TUI.
# Start k9s
k9s
# Target a specific namespace
k9s -n staging
# Use a specific kubeconfig context
k9s --context prod-cluster
# Read-only mode (no mutations)
k9s --readonly? Show help / all key bindings
: Command mode (type a resource name)
/ Filter current list (regex supported)
Esc Go back / clear filter
Ctrl+a Show all resources (alias list)
Ctrl+e Toggle header
Ctrl+r Refresh current view
q Quit k9s# Navigate to resource type by name or alias
:pods (or :po)
:deployments (or :deploy)
:services (or :svc)
:nodes (or :no)
:namespaces (or :ns)
:configmaps (or :cm)
:secrets
:events (or :ev)
:ingress (or :ing)
:hpa
:pv / :pvc
:crds (custom resource definitions)# On a selected pod:
l Stream logs
Shift+l Previous container logs
e Exec into container (opens shell)
d Describe resource (kubectl describe)
s Shell (exec /bin/sh)
Ctrl+k Kill / delete pod
f Port-forward (prompts for local:remote)
y Show YAML
Ctrl+d Diff current YAML vs live# Inside log view:
w Toggle line wrap
f Toggle full-screen
/ Filter log lines (regex)
0 Show all containers
Ctrl+s Save logs to file (~/.k9s/logs/)
Shift+s Toggle timestamps# Sort columns (in list view)
Shift+o Sort by age (oldest first)
Shift+n Sort by name
Shift+r Sort by restarts
Shift+c Sort by CPU
Shift+m Sort by memory
Shift+t Sort by namespace
# Filter by label
/app=my-service (filter pods by label)
/-n production (filter by namespace prefix)# Node view (:nodes)
c Cordon node
u Uncordon node
d Describe node
Shift+p Show pods on this node
Ctrl+k Drain node (prompts)
# Cluster-level
:ctx Switch kubeconfig context
:helm Browse Helm releases
:pu PodDisruptionBudgets# Config location
~/.config/k9s/config.yaml (main config)
~/.config/k9s/aliases.yaml (custom aliases)
~/.config/k9s/hotkeys.yaml (custom hotkeys)
~/.config/k9s/skins/ (colour themes)
# Example alias (aliases.yaml)
aliases:
dp: deployments
rs: replicasets