kubectl port-forward svc/web 8080:80

Category: Kubernetes & Containers

kubectl port-forward svc/web 8080:80

Forward a local port to a service

Exposes the web service's port 80 as localhost:8080 on your machine, letting you reach cluster-internal services without publishing them. Great for debugging APIs and databases. Stop with Ctrl-C; the tunnel closes when the command exits.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.