Kubectl port-forward
kubectl port-forward is a Kubernetes command that forwards connections from local ports to ports on pods or other Kubernetes resources.
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
- kubectluses · kubectl is the Kubernetes command-line client for communicating with the Kubernetes API and managing cluster resources.
- kubernetes api serveruses · The Kubernetes API server is the control-plane component that exposes, validates, and processes the Kubernetes API for managing cluster resources and state.
- poduses · A Kubernetes Pod is the smallest deployable unit in Kubernetes, grouping one or more co-located containers that share networking and other resources.
- kubeletuses · The kubelet is the Kubernetes node agent that manages Pod containers, ensures they run according to their specifications, and reports their status to the control plane.
- port forwardingkind of · Port forwarding is a networking technique that redirects traffic from a port on one endpoint to a port or service on another endpoint.
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.

