$linuxjunkies
>

k9s(1)

A terminal UI and visual dashboard for managing Kubernetes clusters interactively.

UbuntuDebianFedoraArch

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

FlagWhat it does
-A, --all-namespacesShow resources across all namespaces on startup
-n, --namespace STRINGStart in a specific namespace (default: current context namespace)
-c, --command STRINGExecute a command on startup (e.g., 'pod', 'node', 'service')
--context STRINGUse a specific kubeconfig context
--kubeconfig STRINGPath to kubeconfig file (default: $HOME/.kube/config)
-l, --logLevel STRINGLog level verbosity (info, warn, error, debug)
--headlessStart in headless mode without displaying the UI
--write-configWrite default config to $HOME/.k9s/config.yaml and exit

Examples

Launch k9s connected to the current Kubernetes context and namespace

k9s

Start k9s showing all namespaces across the cluster

k9s -A

Launch k9s directly to the pods view in the 'production' namespace

k9s -n production -c pod

Connect k9s to the 'staging' kubeconfig context

k9s --context staging

Use a specific kubeconfig file instead of the default

k9s --kubeconfig /etc/kubernetes/admin.conf

Start k9s with debug-level logging for troubleshooting

k9s -l debug

Related commands