k9s(1)
A terminal UI and visual dashboard for managing Kubernetes clusters interactively.
Synopsis
k9s [FLAGS] [COMMAND]Description
k9s is a terminal-based UI that provides an intuitive interface for navigating, observing, and managing Kubernetes resources. It allows you to view pods, nodes, services, deployments, and other cluster objects in real-time, with shortcuts for common operations like viewing logs, executing commands in containers, and port-forwarding.
k9s connects to your configured Kubernetes cluster via kubeconfig and requires kubectl to be installed. It supports multiple namespaces, resource filtering, and offers vi-like keybindings for efficient navigation.
Common options
| Flag | What it does |
|---|---|
-A, --all-namespaces | Show resources across all namespaces on startup |
-n, --namespace STRING | Start in a specific namespace (default: current context namespace) |
-c, --command STRING | Execute a command on startup (e.g., 'pod', 'node', 'service') |
--context STRING | Use a specific kubeconfig context |
--kubeconfig STRING | Path to kubeconfig file (default: $HOME/.kube/config) |
-l, --logLevel STRING | Log level verbosity (info, warn, error, debug) |
--headless | Start in headless mode without displaying the UI |
--write-config | Write default config to $HOME/.k9s/config.yaml and exit |
Examples
Launch k9s connected to the current Kubernetes context and namespace
k9sStart k9s showing all namespaces across the cluster
k9s -ALaunch k9s directly to the pods view in the 'production' namespace
k9s -n production -c podConnect k9s to the 'staging' kubeconfig context
k9s --context stagingUse a specific kubeconfig file instead of the default
k9s --kubeconfig /etc/kubernetes/admin.confStart k9s with debug-level logging for troubleshooting
k9s -l debug