K9s Socat: Streamlined Kubernetes Port Forwarding

What is K9s Socat?
K9s Socat mode lets you create port-forwarding sessions directly from the K9s interface. It wraps the kubectl port-forward behavior with a simple, interactive workflow inside K9s. No extra scripts. No context switches. You select a pod or service, choose Socat, and instantly forward ports over a live connection.

Why use Socat in K9s?

  • Speed: One command inside K9s vs. multiple steps in kubectl.
  • Visibility: See active forwards in real time from the K9s display.
  • Control: Manage forwards without leaving the tool you already use to monitor logs and metrics.

K9s Socat setup

  1. Launch K9s with the correct Kubernetes context.
  2. Move to the pod or service you want to tunnel traffic to.
  3. Hit Shift+F or the configured Socat shortcut.
  4. Specify local and remote ports. For example, forwarding localhost:8080 to pod port 80.
  5. Confirm. The tunnel starts instantly, visible in K9s.

Use cases

  • Testing APIs in a remote pod from your local machine.
  • Accessing internal dashboards without exposing them cluster-wide.
  • Debugging services with restricted ingress.

Tips for stability
Keep an eye on the forward session in K9s. If a pod restarts, restart the Socat tunnel. Use dedicated namespaces or context switches to avoid port conflicts.

K9s Socat streamlines Kubernetes port forwarding. It’s faster, cleaner, and built into the tool you already trust.

Want to see it in action without spending hours on setup? Go to hoop.dev and spin up K9s Socat workflows live in minutes.