Skip to content

Commit bdee774

Browse files
priyawadhwadgageot
priyawadhwa
authored andcommitted
Add portforward diagram to docs (#2353)
1 parent 44111c3 commit bdee774

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

docs/content/en/docs/how-tos/portforward/_index.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,28 @@ If port 9000 is unavailable, Skaffold will forward to a random open port.
4545
Skaffold will run `kubectl port-forward` on each of these resources in addition to the automatic port forwarding described above.
4646
Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`.
4747

48-
//TODO: table/explain for which field is optional/mandatory in which cases
49-
//"little" diagram of port forwarding and log tailing from skaffold to one of the multiple pods
5048

49+
| Field | Values | Mandatory |
50+
| ------------- |-------------| -----|
51+
| resourceType | `pod`, `service`, `deployment`, `replicaset`, `statefulset`, `replicationcontroller`, `daemonset`, `job`, `cronjob` | Yes |
52+
| resourceName | Name of the resource to forward. | Yes |
53+
| namespace | The namespace of the resource to port forward. | No. Defaults to `default` |
54+
| port | Port is the resource port that will be forwarded. | Yes |
55+
| localPort | LocalPort is the local port to forward too. | No. Defaults to value set for `port`. |
5156

57+
58+
Skaffold will run `kubectl port-forward` on all user defined resources.
59+
`kubectl port-forward` will select one pod created by that resource to forward too.
60+
61+
For example, forwarding a deployment that creates 3 replicas could look like this:
62+
63+
```yaml
64+
portForward:
65+
- resourceType: deployment
66+
resourceName: myDep
67+
namespace: mynamespace
68+
port: 8080
69+
localPort: 9000
70+
```
71+
72+
![portforward_deployment](/images/portforward.png)

docs/static/images/portforward.png

26.1 KB
Loading

0 commit comments

Comments
 (0)