This page discusses how Skaffold sets up port forwarding for container ports from pods. When Skaffold deploys an application, it will automatically forward any ports mentioned in the pod spec.
With the following pod manifest, Skaffold will forward port 8000 to port 8000 on our machine:
- name: skaffold-example
- name: web
If port 8000 isn't available, another random port will be chosen. Currently, only containers that contain images specified as skaffold artifacts will be port forwarded. In other words, port forwarding will not work for containers which reference images not built by the skaffold itself (e.g. official images hosted on 3rd party container registries such as Docker Hub, docker.elastic.co, etc.). We're working on adding user defined port-forwarding, which would allow you to specify additional containers to port-forward.