Master K9s: Install, Run, and Navigate Kubernetes via Terminal UI
This guide walks you through installing K9s on Windows, Linux, and Docker, explains its core features like XRay, Pulse, and Popeye, and provides essential hot‑key shortcuts for efficient Kubernetes cluster management using a terminal UI.
Preface
K9sis a terminal‑UI based Kubernetes management tool that offers a richer experience than kubebox.
The article demonstrates installing k9s on Windows, Linux, and via Docker.
Simple hot‑key usage is covered.
Readers are invited to point out any inaccuracies.
"I only desire to put my true nature into life, why is it so hard?" – Hermann Hesse, Demian K9s is a terminal‑based tool for managing Kubernetes clusters, aiming to simplify cluster administration. It is similar to kubebox but adds continuous monitoring, quick commands, and resource interaction. When you can only use a terminal, k9s is an excellent choice.
K9sprovides special functions such as the xray view for resource dependencies, the pulse view for cluster health, and the popeye scanner that reports configuration issues.
Installation
Windows client
PS C:\Program Files> choco install k9s
Chocolatey v1.1.0
Installing the following packages:
k9s
... (installation output truncated for brevity) ...After downloading, place your kubeconfig file in the default location.
PS C:\Users\山河已无恙\.kube> ls
Directory: C:\Users\山河已无恙\.kube
Mode LastWriteTime Length Name
---- ------------- ------ ----
... (listing truncated) ...
PS C:\Users\山河已无恙\.kube> cat .\config
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ...Start K9s from the command line:
PS C:\ProgramData\chocolatey\lib\k9s\tools> .\k9s.exeLinux client
Download the package: # curl -sS https://webinstall.dev/k9s | bash Extract and run:
# tar -zxvf k9s_Linux_x86_64.tar.gz
LICENSE
README.md
k9s
# ls
k9s k9s_Linux_x86_64.tar.gz LICENSE README.md
# ./k9sDocker installation
You can also run K9s directly with Docker:
# docker run --rm -it -v ~/.kube/config:/root/.kube/config docker.io/derailed/k9sView resource status information:
View resource dependency relationships:
Hot‑keys
Show active keyboard mnemonics and help: ? Show all resource aliases: ctrl-a Exit K9s: :q, ctrl-c View a resource (e.g., pods):
: po⏎View a resource in a specific namespace:
: alias namespace⏎Filter resources:
/ filter⏎Inverse regex filter:
/ ! filter⏎Filter by labels:
/ -l label-selector⏎Fuzzy find a resource:
/ -f filter⏎Cancel view/command/filter mode: <esc> Describe, view, edit, view logs, etc.: d, v, e, l …
Switch Kubernetes context:
: ctx⏎or ctx context-name⏎ Switch Kubernetes namespace:
: ns⏎Save a screenshot:
: screendumpor sd⏎ Delete a resource (confirm with TAB/ENTER): ctrl-d Kill a resource (no confirmation): ctrl-k Launch pulses view:
: pulsesor pu⏎ Launch XRay view:
: xray RESOURCE [NAMESPACE]⏎Launch Popeye view:
: popeyeor
pop⏎References
https://github.com/derailed/k9s
https://k9scli.io
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
