kubectl-port-forward
forwards local ports to a pod, service, or deployment
TLDR
Forward local port to pod
SYNOPSIS
kubectl port-forward type/name local:remote [options]
DESCRIPTION
kubectl port-forward creates a network tunnel between a local port on your machine and a port on a pod, service, or deployment running inside a Kubernetes cluster. Traffic sent to the local port is forwarded through the Kubernetes API server to the target resource, allowing you to access cluster-internal services without exposing them via a LoadBalancer or NodePort.
This is particularly useful for debugging, accessing dashboards, connecting to databases, or testing services that are not publicly exposed. By default it listens on localhost, but you can use the --address flag to bind to additional interfaces such as 0.0.0.0 for sharing access across a local network. The port mapping is specified as local:remote, and the tunnel remains active until the command is terminated.
PARAMETERS
--address address
Addresses to listen on.-n, --namespace name
Kubernetes namespace.
SEE ALSO
kubectl(1), kubectl-proxy(1)
