JAEN

Kubernetes

kubectl port-forward

SafePort-forward

kubectl port-forward <pod> <local>:<remote> -n <ns>

Forwards an in-cluster pod/service to a local port for testing.

Examples

  • kubectl port-forward svc/web 8080:80 -n prodForward to localhost:8080

Syntax

kubectl port-forward <pod|svc> <local>:<remote> -n <ns>

Before you run it

Temporary tunnel; Ctrl+C to stop.

Used when you see

502/504 through the Ingress
4
Port-forward to bypass the Ingress and isolate
See the whole flow →

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store