liveBook · Manning

Kubectl port-forward

kubectl port-forward is a Kubernetes command that forwards connections from local ports to ports on pods or other Kubernetes resources.

How 2 Manning books explain it

Kubernetes in Action, Second Edition

kubectl port-forward is a kubectl operation that forwards traffic from a local port to a port on a Kubernetes resource such as a pod.

How it is used
Supports local development and troubleshooting by proxying requests to applications running in pods.
How deep it goes
Explains commands, local responses, multi-port forwarding, and the proxy path through cluster components.
Examples
Uses Kiada pod requests, localhost curl commands, and HTTP, HTTPS, and administration ports in a multi-container pod.
What you can do after
Apply it via kubectl to access pod or service ports locally and test application responses with curl or a browser.

Read how Kubernetes in Action, Second Edition explains kubectl port-forward →

Learn Docker in a Month of Lunches, Second Edition

kubectl port-forward is a kubectl command that forwards local network traffic to a port on a Kubernetes Pod or other resource.

How it is used
Uses a local network path to test or debug a Pod that is otherwise unreachable from outside the Kubernetes cluster.
How deep it goes
Explains the traffic path and demonstrates one command, but stops short of detailed forwarding internals.
Examples
Demonstrates forwarding localhost:8015 to numbers-api port 80 and browsing to /rng.
What you can do after
Operate/configure kubectl port-forward to reach and debug a Pod through a local browser.

Read how Learn Docker in a Month of Lunches, Second Edition explains kubectl port-forward →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.