Skip to content

Commit a25e0c5

Browse files
committed
[zh] Sync web page for port forward
This is for part of work in the umbrella issue: [zh] Umbrella issue: pages out of sync in tasks section #26178 Portforward (L) content/zh/docs/tasks/access-application-cluster/port-forward-access-application-cluster.md
1 parent ae0600d commit a25e0c5

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

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

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,22 @@ for database debugging.
213213
以上所有命令都应该有效。输出应该类似于:
214214

215215
```
216-
I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:7000 -> 6379
217-
I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:7000 -> 6379
216+
Forwarding from 127.0.0.1:7000 -> 6379
217+
Forwarding from [::1]:7000 -> 6379
218218
```
219+
<!--
220+
{{< note >}}
221+
222+
`kubectl port-forward` does not return. To continue with the exercises, you will need to open another terminal.
223+
224+
{{< /note >}}
225+
-->
226+
{{< note >}}
227+
228+
`kubectl port-forward` 不会返回。你需要打开另一个终端来继续这个练习。
229+
230+
{{< /note >}}
231+
219232

220233
<!--
221234
2. Start the Redis command line interface:
@@ -232,13 +245,44 @@ for database debugging.
232245
3. 在 Redis 命令行提示符下,输入 `ping` 命令:
233246

234247
```
235-
127.0.0.1:7000>ping
248+
ping
236249
```
237250

238251
<!--
239-
A successful ping request returns PONG.
252+
A successful ping request returns:
240253
-->
241-
成功的 ping 请求应该返回 PONG。
254+
成功的 ping 请求应该返回:
255+
256+
```
257+
PONG
258+
```
259+
<!--
260+
### Optionally let _kubectl_ choose the local port {#let-kubectl-choose-local-port}
261+
-->
262+
### (可选操作)让 _kubectl_ 来选择本地端口 {#let-kubectl-choose-local-port}
263+
264+
<!--
265+
If you don't need a specific local port, you can let `kubectl` choose and allocate
266+
the local port and thus relieve you from having to manage local port conflicts, with
267+
the slightly simpler syntax:
268+
-->
269+
如果你不需要指定特定的本地端口,你可以让 `kubectl` 来选择和分配本地端口,
270+
以便你不需要管理本地端口冲突。该命令使用稍微不同的语法:
271+
272+
```shell
273+
kubectl port-forward deployment/redis-master :6379
274+
```
275+
<!--
276+
The `kubectl` tool finds a local port number that is not in use (avoiding low ports numbers,
277+
because these might be used by other applications). The output is similar to:
278+
-->
279+
`kubectl` 工具会找到一个未被使用的本地端口号(避免使用低段位的端口号,因为他们可能会被其他应用程序使用)。输出应该类似于:
280+
281+
```
282+
Forwarding from 127.0.0.1:62162 -> 6379
283+
Forwarding from [::1]:62162 -> 6379
284+
```
285+
242286

243287
<!-- discussion -->
244288

0 commit comments

Comments
 (0)