Skip to content

Commit 7bb8e5c

Browse files
committed
[zh] Sync1.25 /tutorials/hello-minikube.md
1 parent a4b6b86 commit 7bb8e5c

File tree

1 file changed

+26
-30
lines changed

1 file changed

+26
-30
lines changed

content/zh-cn/docs/tutorials/hello-minikube.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,15 @@ Katacoda provides a free, in-browser Kubernetes environment.
3737
本教程向你展示如何使用 Minikube 和 Katacoda
3838
在 Kubernetes 上运行一个应用示例。Katacoda 提供免费的浏览器内 Kubernetes 环境。
3939

40-
<!--
4140
{{< note >}}
41+
<!--
4242
You can also follow this tutorial if you've installed minikube locally.
4343
See [minikube start](https://minikube.sigs.k8s.io/docs/start/) for installation instructions.
44-
{{< /note >}}
4544
-->
46-
{{< note >}}
4745
如果你已在本地安装 Minikube,也可以按照本教程操作。
4846
安装指南参阅 [minikube start](https://minikube.sigs.k8s.io/docs/start/)
4947
{{< /note >}}
5048

51-
5249
## {{% heading "objectives" %}}
5350

5451
<!--
@@ -58,11 +55,10 @@ See [minikube start](https://minikube.sigs.k8s.io/docs/start/) for installation
5855
-->
5956
* 将一个示例应用部署到 Minikube。
6057
* 运行应用程序。
61-
* 查看应用日志
58+
* 查看应用日志
6259

6360
## {{% heading "prerequisites" %}}
6461

65-
6662
<!--
6763
This tutorial provides a container image that uses NGINX to echo back all the requests.
6864
-->
@@ -75,19 +71,19 @@ This tutorial provides a container image that uses NGINX to echo back all the re
7571
7672
1. Click **Launch Terminal**
7773
-->
78-
## 创建 Minikube 集群
74+
## 创建 Minikube 集群 {#create-a-minikube-cluster}
7975

80-
1. 点击 **启动终端**
76+
1. 点击 **Launch Terminal**
8177

8278
{{< kat-button >}}
8379

80+
{{< note >}}
8481
<!--
8582
If you installed minikube locally, run `minikube start`. Before you run `minikube dashboard`, you should open a new terminal, start `minikube dashboard` there, and then switch back to the main terminal.
8683
-->
87-
{{< note >}}
8884
如果你在本地安装了 Minikube,运行 `minikube start`
8985
在运行 `minikube dashboard` 之前,你应该打开一个新终端,
90-
在此启动 `minikube dashboard` ,然后切换回主终端。
86+
在此启动 `minikube dashboard` ,然后切换回主终端。
9187
{{< /note >}}
9288

9389
<!--
@@ -102,15 +98,16 @@ This tutorial provides a container image that uses NGINX to echo back all the re
10298
<!--
10399
3. Katacoda environment only: At the top of the terminal pane, click the plus sign, and then click **Select port to view on Host 1**.
104100
-->
105-
3. 仅限 Katacoda 环境:在终端窗口的顶部,单击加号,然后单击 **选择要在主机 1 上查看的端口**
101+
3. 仅限 Katacoda 环境:在终端窗口的顶部,单击加号,然后单击 **Select port to view on Host 1**
106102

107103
<!--
108104
4. Katacoda environment only: Type `30000`, and then click **Display Port**.
109105
-->
110-
4. 仅限 Katacoda 环境:输入30000,然后单击 **显示端口**
106+
4. 仅限 Katacoda 环境:输入 `30000`,然后单击 **Display Port**
111107

108+
{{< note >}}
112109
<!--
113-
The `dashboard` command enables the dashboard add-on and opens the proxy in the default web browser.
110+
The `dashboard` command enables the dashboard add-on and opens the proxy in the default web browser.
114111
You can create Kubernetes resources on the dashboard such as Deployment and Service.
115112
116113
If you are running in an environment as root, see [Open Dashboard with URL](#open-dashboard-with-url).
@@ -122,7 +119,6 @@ To stop the proxy, run `Ctrl+C` to exit the process.
122119
After the command exits, the dashboard remains running in the Kubernetes cluster.
123120
You can run the `dashboard` command again to create another proxy to access the dashboard.
124121
-->
125-
{{< note >}}
126122
`dashboard` 命令启用仪表板插件,并在默认的 Web 浏览器中打开代理。
127123
你可以在仪表板上创建 Kubernetes 资源,例如 Deployment 和 Service。
128124

@@ -135,13 +131,12 @@ You can run the `dashboard` command again to create another proxy to access the
135131
要停止代理,请运行 `Ctrl+C` 退出该进程。仪表板仍在运行中。
136132
命令退出后,仪表板仍然在 Kubernetes 集群中运行。
137133
你可以再次运行 `dashboard` 命令创建另一个代理来访问仪表板。
138-
139134
{{< /note >}}
140135

141136
<!--
142137
## Open Dashboard with URL
143138
-->
144-
## 使用 URL 打开仪表板
139+
## 使用 URL 打开仪表板 {#open-dashboard-with-url}
145140

146141
<!--
147142
If you don't want to open a web browser, run the dashboard command with the `--url` flag to emit a URL:
@@ -153,7 +148,6 @@ minikube dashboard --url
153148
```
154149

155150
<!--
156-
157151
## Create a Deployment
158152
159153
A Kubernetes [*Pod*](/docs/concepts/workloads/pods/) is a group of one or more Containers,
@@ -164,11 +158,11 @@ Pod and restarts the Pod's Container if it terminates. Deployments are the
164158
recommended way to manage the creation and scaling of Pods.
165159
-->
166160

167-
## 创建 Deployment
161+
## 创建 Deployment {#create-a-deployment}
168162

169-
Kubernetes [*Pod*](/zh-cn/docs/concepts/workloads/pods/) 是由一个或多个
170-
为了管理和联网而绑定在一起的容器构成的组。 本教程中的 Pod 只有一个容器。
171-
Kubernetes [*Deployment*](/zh-cn/docs/concepts/workloads/controllers/deployment/)
163+
Kubernetes [**Pod**](/zh-cn/docs/concepts/workloads/pods/)
164+
是由一个或多个为了管理和联网而绑定在一起的容器构成的组。本教程中的 Pod 只有一个容器。
165+
Kubernetes [**Deployment**](/zh-cn/docs/concepts/workloads/controllers/deployment/)
172166
检查 Pod 的健康状况,并在 Pod 中的容器终止的情况下重新启动新的容器。
173167
Deployment 是管理 Pod 创建和扩展的推荐方法。
174168

@@ -180,7 +174,7 @@ Pod runs a Container based on the provided Docker image.
180174
镜像运行 Container。
181175

182176
```shell
183-
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
177+
kubectl create deployment hello-node --image=registry.k8s.io/echoserver:1.4
184178
```
185179

186180
<!--
@@ -242,11 +236,11 @@ Pod runs a Container based on the provided Docker image.
242236
kubectl config view
243237
```
244238

239+
{{< note >}}
245240
<!--
246241
For more information about `kubectl`commands, see the
247242
[kubectl overview](/docs/reference/kubectl/).
248243
-->
249-
{{< note >}}
250244
有关 `kubectl` 命令的更多信息,请参阅 [kubectl 概述](/zh-cn/docs/reference/kubectl/)
251245
{{< /note >}}
252246

@@ -258,11 +252,11 @@ Kubernetes cluster. To make the `hello-node` Container accessible from outside t
258252
Kubernetes virtual network, you have to expose the Pod as a
259253
Kubernetes [*Service*](/docs/concepts/services-networking/service/).
260254
-->
261-
## 创建 Service
255+
## 创建 Service {#create-a-service}
262256

263257
默认情况下,Pod 只能通过 Kubernetes 集群中的内部 IP 地址访问。
264258
要使得 `hello-node` 容器可以从 Kubernetes 虚拟网络的外部访问,你必须将 Pod
265-
暴露为 Kubernetes [*Service*](/zh-cn/docs/concepts/services-networking/service/)
259+
暴露为 Kubernetes [**Service**](/zh-cn/docs/concepts/services-networking/service/)
266260

267261
<!--
268262
1. Expose the Pod to the public internet using the `kubectl expose` command:
@@ -277,12 +271,13 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
277271
The `--type=LoadBalancer` flag indicates that you want to expose your Service
278272
outside of the cluster.
279273
280-
The application code inside the image `k8s.gcr.io/echoserver` only listens on TCP port 8080. If you used
274+
The application code inside the image `registry.k8s.io/echoserver` only listens on TCP port 8080. If you used
281275
`kubectl expose` to expose a different port, clients could not connect to that other port.
282276
-->
277+
283278
这里的 `--type=LoadBalancer` 参数表明你希望将你的 Service 暴露到集群外部。
284279

285-
镜像 `k8s.gcr.io/echoserver` 中的应用程序代码仅监听 TCP 8080 端口。
280+
镜像 `registry.k8s.io/echoserver` 中的应用程序代码仅监听 TCP 8080 端口。
286281
如果你用 `kubectl expose` 暴露了其它的端口,客户端将不能访问其它端口。
287282

288283
<!--
@@ -312,6 +307,7 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
312307
the `LoadBalancer` type makes the Service accessible through the `minikube service`
313308
command.
314309
-->
310+
315311
对于支持负载均衡器的云服务平台而言,平台将提供一个外部 IP 来访问该服务。
316312
在 Minikube 上,`LoadBalancer` 使得服务可以通过命令 `minikube service` 访问。
317313

@@ -327,7 +323,7 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
327323
<!--
328324
4. Katacoda environment only: Click the plus sign, and then click **Select port to view on Host 1**.
329325
-->
330-
4. 仅限 Katacoda 环境:单击加号,然后单击 **选择要在主机 1 上查看的端口**
326+
4. 仅限 Katacoda 环境:单击加号,然后单击 **Select port to view on Host 1**
331327

332328
<!--
333329
5. Katacoda environment only: Note the 5-digit port number displayed opposite to `8080` in services output. This port number is randomly generated and it can be different for you. Type your number in the port number text box, then click Display Port. Using the example from earlier, you would type `30369`.
@@ -336,7 +332,7 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
336332
-->
337333
5. 仅限 Katacoda 环境:请注意在 service 输出中与 `8080` 对应的长度为 5 位的端口号。
338334
此端口号是随机生成的,可能与你的不同。
339-
在端口号文本框中输入你自己的端口号,然后单击显示端口
335+
在端口号文本框中输入你自己的端口号,然后单击 **Display Port**
340336
对应于上面的例子,需要输入 `30369`
341337

342338
这将打开一个浏览器窗口,为你的应用程序提供服务并显示应用的响应。
@@ -463,7 +459,7 @@ Minikube 有一组内置的 {{< glossary_tooltip text="插件" term_id="addons"
463459
464460
Now you can clean up the resources you created in your cluster:
465461
-->
466-
## 清理
462+
## 清理 {#clean-up}
467463

468464
现在可以清理你在集群中创建的资源:
469465

0 commit comments

Comments
 (0)