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 on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store