Skip to content

Commit d77eabb

Browse files
authored
Merge pull request #25381 from cdemers/patch-1
Update port-forward-access-application-cluster.md
2 parents 20f97c6 + 590cac5 commit d77eabb

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

content/en/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ for database debugging.
158158
Any of the above commands works. The output is similar to this:
159159
160160
```
161-
I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:7000 -> 6379
162-
I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:7000 -> 6379
161+
Forwarding from 127.0.0.1:7000 -> 6379
162+
Forwarding from [::1]:7000 -> 6379
163163
```
164164
165165
2. Start the Redis command line interface:
@@ -180,7 +180,23 @@ for database debugging.
180180
PONG
181181
```
182182
183+
### Optionally let _kubectl_ choose the local port {#let-kubectl-choose-local-port}
183184
185+
If you don't need a specific local port, you can let `kubectl` choose and allocate
186+
the local port and thus relieve you from having to manage local port conflicts, with
187+
the slightly simpler syntax:
188+
189+
```shell
190+
kubectl port-forward deployment/redis-master :6379
191+
```
192+
193+
The `kubectl` tool finds a local port number that is not in use (avoiding low ports numbers,
194+
because these might be used by other applications). The output is similar to:
195+
196+
```
197+
Forwarding from 127.0.0.1:62162 -> 6379
198+
Forwarding from [::1]:62162 -> 6379
199+
```
184200
185201
186202
<!-- discussion -->
@@ -203,4 +219,3 @@ The support for UDP protocol is tracked in
203219
## {{% heading "whatsnext" %}}
204220
205221
Learn more about [kubectl port-forward](/docs/reference/generated/kubectl/kubectl-commands/#port-forward).
206-

0 commit comments

Comments
 (0)