Port forward to Pods

Port forward to Pods

TL;DR

  • Port Forward local connections to Pods running in a cluster

Port Forward

Motivation

Connect to ports of Pods running a cluster by port forwarding local ports.

Forward Multiple Ports

Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod

  1. kubectl port-forward pod/mypod 5000 6000

Operations

One can also perfrom operations such as, Port Forward to:

  • Pod in a Workload
  • Different Local and Remote Ports
  • Random Local Port

Command / Examples

Check out the reference for commands and examples of port forwarding