Commands.app

kubectl port-forward

Networking

Forward local port to pod

Examples
Common usage examples

Forward local 8080 to pod 80

kubectl port-forward mypod 8080:80

Forward to service

kubectl port-forward svc/myservice 8080:80

Forward to deployment

kubectl port-forward deploy/myapp 8080:80

Listen on all interfaces

kubectl port-forward mypod 8080:80 --address 0.0.0.0
Notes
  • Useful for debugging services locally
Related Commands
You might also find these useful