Skip to content

Commit

Permalink
docs: Add Docker port-forwarding note (#7176)
Browse files Browse the repository at this point in the history
  • Loading branch information
datumest authored Mar 10, 2022
1 parent 4316973 commit e0bb133
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/content/en/docs/pipeline-stages/port-forwarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ Skaffold will request matching local ports only when the remote port is `> 1023`
User-defined port-forwards in the `skaffold.yaml` are unaffected and can bind to system ports.
{{< /alert >}}

{{< alert title="Note about user-defined port-forwarding for Docker deployments" >}}
When [deploying to Docker]({{< relref "/pipeline-stages/deployers/docker" >}}) with a user-defined port-forward in the `skaffold.yaml`, the `resourceType` of `portForward` must be set to `container`. Otherwise, Skaffold will not tell the Docker daemon to expose that port.
{{< /alert >}}

Skaffold will run `kubectl port-forward` on each of these resources in addition to the automatic port forwarding described above.
Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`.


| Field | Values | Mandatory |
| ------------- |-------------| -----|
| resourceType | `pod`, `service`, `deployment`, `replicaset`, `statefulset`, `replicationcontroller`, `daemonset`, `job`, `cronjob` | Yes |
| resourceType | `pod`, `service`, `deployment`, `replicaset`, `statefulset`, `replicationcontroller`, `daemonset`, `job`, `cronjob`, `container` | Yes |
| resourceName | Name of the resource to forward. | Yes |
| namespace | The namespace of the resource to port forward. | No. Defaults to current namespace, or `default` if no current namespace is defined |
| port | Port is the resource port that will be forwarded. | Yes |
Expand Down

0 comments on commit e0bb133

Please sign in to comment.