K9s Cheat Sheet
K9s Cheat Sheet
πΆ K9s Cheat Sheet
I had been looking for a k9βs for a while and have not found any that do not have advertisments so here are mine that I had Chatgpt rewrite. I have also included this as a downloadable PDF and Text file.
π Launching K9s
1
2
3
4
5
k9s # Launch using default kubeconfig
k9s --kubeconfig /path # Use specific kubeconfig
k9s --context myctx # Use specific context
k9s --readonly # Launch in read-only mode
k9s info # Show config/log paths
π Command Mode (:
)
:pod
,:svc
,:deploy
, etc. β Go to resource view:ctx
β Change context:ns
β Change namespace:aliases
orCtrl-a
β Show resource aliases:crd
β View custom resources:apiservices
,:secrets
,:helm
β Specialized views:xray RESOURCE
β Show resource graph:pulse
β Cluster overview:popeye
or:pop
β Run Popeye linter:dir /path
β Browse disk files (e.g., saved YAML)
π Filtering
/pattern
β Regex filter/!pattern
β Inverse regex/-l key=value
β Filter by label/-f value
β Fuzzy text match
π§ Navigation
j
/k
β Move down/uph
/l
β Left/right in logsSPACE
β Select for bulk actionsEsc
β Exit view or cancelCtrl-c
or:q
β Quit K9s
π Resource Actions
y
β Copy YAMLd
β Describev
β View detailse
β Edit resourcel
β View logss
β Scale deployments or exec into containerx
β Decode secretsw
β Toggle log line wrappingf
β Toggle full-screen mode
βοΈ Shortcuts & Toggles
Ctrl-d
β Delete (with confirmation)Ctrl-k
β Kill immediatelyCtrl-w
β Toggle wide layoutCtrl-z
β Toggle error logCtrl-e
β Hide headerCtrl-s
β Save output to fileCtrl-l
β Rollback last apply
π Sorting (Shift + key)
Shift-c
β Sort by CPUShift-m
β Sort by MemoryShift-s
β Sort by StatusShift-p
β Sort by NamespaceShift-n
β Sort by NameShift-o
β Sort by NodeShift-i
β Sort by IPShift-a
β Sort by AgeShift-t
β Sort by RestartsShift-r
β Sort by Readiness
π οΈ Special Views & Utilities
:helm
β View Helm releases:xray
β Visualize pod relationships:pulse
β Cluster dashboard:popeye
β Run linting tool:dir /path
β Navigate file system
β Help & Exit
?
β Contextual helpEsc
β Go back/cancel:q
orCtrl-c
β Exit K9s
π‘ Tips
- Use
f
to toggle full-screen view for easier YAML copying - Use
/
to live filter resources - Press
?
for contextual help in every view
1
2
3
4
---
Happy kuberneting π§ π³
This post is licensed under CC BY 4.0 by the author.