← Back to list

K9s for Kubernetes: The Terminal Tool That Made Our Production Troubleshooting Faster

When managing Kubernetes clusters, most engineers start with kubectl.

Hari Prasad Nattuva · 2026-06-06 05:56 · 31 claps · 3.7 min read
#kubernetes #k9 #devops #containers
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

K9s for Kubernetes: The Terminal Tool That Made Our Production Troubleshooting Faster

When managing Kubernetes clusters, most engineers start with kubectl.

Initially it works fine.

But as clusters grow, namespaces increase, and production incidents become more frequent, constantly typing long kubectl commands slows everything down.

That’s exactly where K9s changed our daily Kubernetes operations.

In our platform engineering and production support workflows, K9s became one of the most-used tools for:

  • Monitoring pods in real time
  • Viewing logs instantly
  • Checking CPU and memory usage
  • Debugging failing deployments
  • Troubleshooting node issues
  • Navigating clusters faster than kubectl

In this article, I’ll walk through how we use K9s in real production environments, including setup, metrics monitoring, troubleshooting workflows, and essential commands every Kubernetes engineer should know.

What is K9s?

K9s is a terminal-based UI for Kubernetes that provides an interactive dashboard directly inside your terminal.

Instead of repeatedly running commands like:

kubectl get pods -A
kubectl describe pod payment-api
kubectl logs payment-api

K9s allows you to manage and monitor Kubernetes resources interactively.

Think of it as a “top-like terminal UI” for Kubernetes.

Why We Started Using K9s

In large clusters, engineers often spend too much time:

  • Copying pod names
  • Switching namespaces
  • Running describe commands
  • Searching logs
  • Checking events manually

During production incidents, speed matters.

K9s dramatically reduced the time required to investigate issues.

Especially for:

  • CrashLoopBackOff pods
  • Memory spikes
  • Node pressure
  • Deployment failures
  • Container restarts

Installing K9s

Mac

brew install derailed/k9s/k9s

Windows

choco install k9s

Linux

curl -sS https://webinstall.dev/k9s | bash

Verify Kubernetes Connectivity

Before starting K9s:

kubectl config get-contexts

Make sure your kubeconfig is correctly configured.

Launching K9s

Start K9s using:

k9s

K9s automatically connects to the current Kubernetes context.

The first thing you’ll notice is how quickly you can navigate cluster resources compared to raw kubectl commands.

Switching Between Clusters

In enterprise environments, we usually manage multiple clusters:

  • Development
  • QA
  • Staging
  • Production

Inside K9s:

:ctx

This opens the context switcher.

This feature alone helps avoid accidental deployments to production clusters.

Viewing Pods in Real Time

To view pods:

:pods

or simply:

po

You can instantly see:

  • Pod status
  • Restart count
  • CPU usage
  • Memory usage
  • Namespace
  • Node assignment

This became our primary operational dashboard during incidents.

Enabling Metrics in K9s

One of the best K9s features is live CPU and memory monitoring.

However, this requires Kubernetes Metrics Server.

Install Metrics Server

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

Verify metrics:

kubectl top nodes
kubectl top pods -A

Once metrics-server is available, K9s automatically displays:

  • CPU consumption
  • Memory usage
  • Resource pressure

for pods and nodes.

This is extremely useful during memory leak investigations and high CPU incidents.

Viewing Logs Instantly

One of the biggest operational advantages of K9s is log streaming.

Select a pod and press:

l

This immediately opens live logs.

In production troubleshooting, this saves significant time compared to:

kubectl logs -f pod-name

You can also:

  • Filter logs
  • Search logs
  • Switch containers
  • Follow real-time streams

without leaving the terminal UI.

Viewing Kubernetes Events

Kubernetes events are often ignored, but they are extremely valuable during failures.

Inside K9s:

:events

This helps quickly identify:

  • Failed scheduling
  • Image pull failures
  • Liveness probe issues
  • OOMKilled containers
  • Node pressure warnings

During a recent deployment issue, events immediately showed:

FailedScheduling: Insufficient memory

which saved time debugging application code unnecessarily.

Monitoring Nodes

To inspect cluster nodes:

:nodes

K9s displays:

  • CPU utilization
  • Memory usage
  • Pod count
  • Node conditions
  • Kubernetes version

This becomes incredibly useful when diagnosing:

  • Resource exhaustion
  • Noisy neighbor issues
  • Pending pods
  • Cluster scaling problems

Debugging CrashLoopBackOff Pods

One of the most common Kubernetes production issues is:

CrashLoopBackOff

Our usual K9s troubleshooting workflow looks like this:

Step 1 — Open Pods View

:pods

Step 2 — Filter Problematic Pods

Use:

/CrashLoopBackOff

Step 3 — Open Logs

Press:

l

Step 4 — Describe the Pod

Press:

d

This reveals:

  • Exit codes
  • Probe failures
  • Restart reasons
  • Events

Step 5 — Check Resource Usage

Verify:

  • CPU spikes
  • Memory saturation
  • OOMKills

directly from the K9s dashboard.

This workflow significantly reduced our Mean Time To Resolution (MTTR).

Executing Into Containers

To open a shell inside a container:

Select pod → press:

s

Equivalent kubectl command:

kubectl exec -it payment-api -- sh

This is extremely useful for:

  • Network debugging
  • DNS verification
  • Config inspection
  • Runtime validation

Port Forwarding

K9s also simplifies port forwarding.

Select pod → press:

shift + f

Very useful for debugging internal services locally.

Useful K9s Shortcuts

ShortcutAction:Command modepoPodsnsNamespacesdeployDeploymentssvcServiceslLogsdDescribesShellctrl+dDelete resource/Search/filtershift+fPort forward

K9s vs kubectl

kubectlK9sCommand-heavyInteractive UISlower navigationFaster troubleshootingManual context switchingEasier cluster navigationSeparate commands for logs/eventsUnified operational viewBetter for scriptingBetter for live operations

We still use kubectl heavily for automation and scripting, but K9s became our preferred operational troubleshooting tool.

Best Practices

Use Read-Only Access for Production

Avoid giving full cluster-admin permissions.

Use Kubernetes RBAC properly.

Install Metrics Server

Without metrics-server, K9s loses some of its best operational capabilities.

Learn Keyboard Shortcuts

Once shortcuts become muscle memory, Kubernetes troubleshooting becomes dramatically faster.

Final Thoughts

K9s is one of the most valuable Kubernetes productivity tools we introduced into our daily DevOps workflow.

It combines:

  • Monitoring
  • Troubleshooting
  • Log analysis
  • Metrics visibility
  • Cluster navigation

into a lightweight terminal experience.

If you work with Kubernetes regularly, K9s can easily save hours every week and significantly improve production incident response time.

For platform engineers, SREs, and DevOps teams, it quickly becomes difficult to imagine operating Kubernetes clusters without it.


메타데이터
post_id
929cef646e4a
slug
k9s-for-kubernetes-the-terminal-tool-that-made-our-production-troubleshooting-faster-929cef646e4a
url
https://medium.com/@hariprasad.nattuva01/k9s-for-kubernetes-the-terminal-tool-that-made-our-production-troubleshooting-faster-929cef646e4a
canonical_url
https://medium.com/@hariprasad.nattuva01/k9s-for-kubernetes-the-terminal-tool-that-made-our-production-troubleshooting-faster-929cef646e4a
author_url
https://medium.com/@hariprasad.nattuva01
status
ok
fetched_at
2026-06-23 03:48:11