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
Related commands
- kubectl get svcList services
- kubectl execExec into a pod
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