Htop Remote, Container, and Server Recipes/Run htop in a Kubernetes pod

Attach an interactive process view to a pod shell.

Section: Containers and services

Run htop in a Kubernetes pod

bash
bash
kubectl exec -it deploy/api -- htop
Explanation

Works when htop is present in the container image.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Containers and services
Run htop inside a running container
Inspect the process table from the container's perspective.
OpenIn sheetbashsame section
Watch only systemd-managed service processes by pattern
Generate a PID list for one service family.
OpenIn sheetbashsame section
Start a memory-focused out-of-memory investigation
Sort by memory and refresh quickly.
OpenIn sheetbashsame section
Watch for short CPU spikes
Use faster refresh and CPU sorting.
OpenIn sheetbashsame section
Run htop over SSH
Open a remote session directly into htop.
Run htop inside tmux on a remote host
Keep monitoring alive if your connection drops.