Skip to content

Commit 0f9e2f2

Browse files
committed
[zh-cn] sync tutorials/*
Signed-off-by: xin.li <[email protected]>
1 parent 82a9d87 commit 0f9e2f2

File tree

5 files changed

+60
-44
lines changed

5 files changed

+60
-44
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Now, switch back to the terminal where you ran `minikube start`.
103103
The `dashboard` command enables the dashboard add-on and opens the proxy in the default web browser.
104104
You can create Kubernetes resources on the dashboard such as Deployment and Service.
105105
106-
If you are running in an environment as root, see [Open Dashboard with URL](#open-dashboard-with-url).
106+
To find out how to avoid directly invoking the browser from the terminal and get a URL for the web dashboard, see the "URL copy and paste" tab.
107107
108108
By default, the dashboard is only accessible from within the internal Kubernetes virtual network.
109109
The `dashboard` command creates a temporary proxy to make the dashboard accessible from outside the Kubernetes virtual network.
@@ -116,8 +116,8 @@ You can run the `dashboard` command again to create another proxy to access the
116116
`dashboard` 命令启用仪表板插件,并在默认的 Web 浏览器中打开代理。
117117
你可以在仪表板上创建 Kubernetes 资源,例如 Deployment 和 Service。
118118

119-
如果你以 root 用户身份在环境中运行,
120-
请参见[使用 URL 打开仪表板](#open-dashboard-with-url)
119+
要了解如何避免从终端直接调用浏览器并获取 Web 仪表板的 URL,请参阅
120+
"URL 复制和粘贴"选项卡
121121

122122
默认情况下,仪表板只能从内部 Kubernetes 虚拟网络中访问。
123123
`dashboard` 命令创建一个临时代理,使仪表板可以从 Kubernetes 虚拟网络外部访问。
@@ -131,12 +131,12 @@ You can run the `dashboard` command again to create another proxy to access the
131131
{{% tab name="URL 复制粘贴" %}}
132132

133133
<!--
134-
If you don't want minikube to open a web browser for you, run the dashboard command with the
134+
If you don't want minikube to open a web browser for you, run the `dashboard` subcommand with the
135135
`--url` flag. `minikube` outputs a URL that you can open in the browser you prefer:
136136
137137
Open a **new** terminal, and run:
138138
-->
139-
如果你不想 Minikube 为你打开 Web 浏览器,可以使用 `--url` 标志运行仪表板命令
139+
如果你不想 Minikube 为你打开 Web 浏览器,可以使用 `--url` 标志运行 `dashboard` 子命令
140140
`minikube` 会输出一个 URL,你可以在你喜欢的浏览器中打开该 URL。
141141

142142
打开一个**新的**终端,然后运行:
@@ -147,9 +147,9 @@ minikube dashboard --url
147147
```
148148

149149
<!--
150-
Now, switch back to the terminal where you ran `minikube start`.
150+
Now, you can use this URL and switch back to the terminal where you ran `minikube start`.
151151
-->
152-
现在,切换回运行 `minikube start` 的终端。
152+
现在,你可以使用此 URL 并切换回运行 `minikube start` 的终端。
153153

154154
{{% /tab %}}
155155
{{< /tabs >}}
@@ -317,7 +317,7 @@ Kubernetes [*Service*](/docs/concepts/services-networking/service/).
317317
The output is similar to:
318318
-->
319319

320-
输出结果类似于这样:
320+
输出结果类似于这样
321321

322322
```
323323
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE

content/zh-cn/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,23 @@ <h3>部署一个应用</h3>
232232
<div class="col-md-12">
233233
<!--
234234
<h3>View the app</h3>
235-
<p>Pods that are running inside Kubernetes are running on a private, isolated network.
235+
<p><a href="/docs/concepts/workloads/pods/">Pods</a> that are running inside Kubernetes are running on a private, isolated network.
236236
By default they are visible from other pods and services within the same kubernetes cluster,
237237
but not outside that network.
238238
When we use <code>kubectl</code>, we're interacting through an API endpoint to communicate with our application.</p>
239239
<p>We will cover other options on how to expose your application outside the Kubernetes
240-
cluster later, in <a href="/docs/tutorials/kubernetes-basics/expose/">Module 4</a>.</p>
240+
cluster later, in <a href="/docs/tutorials/kubernetes-basics/expose/">Module 4</a>.
241+
Also as a basic tutorial, we're not explaining what <code>Pods</code> are in any detail here, it will cover in later topics.</p>
241242
-->
242243
<h3>查看应用</h3>
243-
<p>在 Kubernetes 内运行的 Pod 运行在一个私有的、隔离的网络上。
244+
<p>在 Kubernetes 内运行的 <a href="/docs/concepts/workloads/pods/">Pod</a>
245+
运行在一个私有的、隔离的网络上。
244246
默认这些 Pod 可以从同一 Kubernetes 集群内的其他 Pod 和服务看到,但超出这个网络后则看不到。
245247
当我们使用 <code>kubectl</code> 时,我们通过 API 端点交互与应用进行通信。</p>
246248
<p><a href="/zh-cn/docs/tutorials/kubernetes-basics/expose/">模块 4</a>
247-
中我们将讲述如何将应用暴露到 Kubernetes 集群外的其他选项。</p>
249+
中我们将讲述如何将应用暴露到 Kubernetes 集群外的其他选项。
250+
同样作为基础教程,我们不会在这里详细解释 <code>Pod</code> 是什么,后面的主题会介绍它。
251+
</p>
248252

249253
<!--
250254
<p>The <code>kubectl proxy</code> command can create a proxy that will forward communications

content/zh-cn/docs/tutorials/kubernetes-basics/expose/expose-intro.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ <h3>Kubernetes Service 总览</h3>
5151
<!--
5252
<p>Kubernetes <a href="/docs/concepts/workloads/pods/">Pods</a> are mortal. Pods have a <a href="/docs/concepts/workloads/pods/pod-lifecycle/">lifecycle</a>. When a worker node dies, the Pods running on the Node are also lost. A <a href="/docs/concepts/workloads/controllers/replicaset/">ReplicaSet</a> might then dynamically drive the cluster back to the desired state via the creation of new Pods to keep your application running. As another example, consider an image-processing backend with 3 replicas. Those replicas are exchangeable; the front-end system should not care about backend replicas or even if a Pod is lost and recreated. That said, each Pod in a Kubernetes cluster has a unique IP address, even Pods on the same Node, so there needs to be a way of automatically reconciling changes among Pods so that your applications continue to function.</p>
5353
-->
54-
55-
<p> Kubernetes <a href="/zh-cn/docs/concepts/workloads/pods/">Pod</a> 是转瞬即逝的。 Pod 拥有 <a href="/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/">生命周期</a>
56-
当一个工作节点挂掉后, 在节点上运行的 Pod 也会消亡。 <a href="/zh-cn/docs/concepts/workloads/controllers/replicaset/">ReplicaSet</a> 会自动地通过创建新的 Pod 驱动集群回到目标状态,以保证应用正常运行。
54+
55+
<p> Kubernetes <a href="/zh-cn/docs/concepts/workloads/pods/">Pod</a> 是转瞬即逝的。 Pod 拥有 <a href="/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/">生命周期</a>
56+
当一个工作节点挂掉后, 在节点上运行的 Pod 也会消亡。 <a href="/zh-cn/docs/concepts/workloads/controllers/replicaset/">ReplicaSet</a> 会自动地通过创建新的 Pod 驱动集群回到目标状态,以保证应用正常运行。
5757
换一个例子,考虑一个具有 3 个副本的用作图像处理的后端程序。
5858
这些副本是可替换的。前端系统不应该关心后端副本,即使某个 Pod 丢失或被重新创建。
5959
此外,Kubernetes 集群中的每个 Pod 都有一个唯一的 IP 地址,即使是在同一个 Node 上的 Pod 也是如此,
@@ -177,8 +177,8 @@ <h3>Service 和 Label</h3>
177177
<br>
178178
<div class="row">
179179
<div class="col-md-12">
180-
<!-- <h3>Create a new Service</h3> -->
181-
<h3>创建新 Service</h3>
180+
<!-- <h3>Step 1: Creating a new Service</h3> -->
181+
<h3>第一步:创建新 Service</h3>
182182
<!--
183183
<p>Let’s verify that our application is running. We’ll use the <code>kubectl get</code> command and look for existing Pods:</p>
184184
-->
@@ -211,7 +211,7 @@ <h3>创建新 Service</h3>
211211
<p>To find out what port was opened externally (for the <tt>type: NodePort</tt> Service) we’ll run the <code>describe service</code> subcommand:</p>
212212
-->
213213
<p>我们现在有一个运行中的 Service 名为 kubernetes-bootcamp。
214-
这里我们看到 Service 收到了一个唯一的集群内 IP(cluster-IP),一个内部端口和一个外部 IP
214+
这里我们看到 Service 收到了一个唯一的集群内 IP(cluster-IP),一个内部端口和一个外部 IP
215215
(external-IP)(Node 的 IP)。</p>
216216
<p>要得到外部打开的端口号(对于 <tt>type: NodePort</tt> 的服务),我们需要运行 <code>describe service</code> 子命令:</p>
217217
<p><code><b>kubectl describe services/kubernetes-bootcamp</b></code></p>
@@ -239,7 +239,7 @@ <h3>创建新 Service</h3>
239239
-->
240240
{{< note >}}<p>如果你正在使用 Docker Desktop 作为容器驱动来运行 minikube, 需要使用 minikube tunnel。
241241
这是因为 Docker Desktop 内部的容器和宿主机是隔离的。<br>
242-
<p>在另一个终端窗口中,执行:<br>
242+
<p>在另一个终端窗口中,执行<br>
243243
<code><b>minikube service kubernetes-bootcamp --url</b></code></p>
244244
<p>输出结果如下:
245245
<pre><b>http://127.0.0.1:51082<br>! Because you are using a Docker driver on darwin, the terminal needs to be open to run it.</b></pre></p>
@@ -300,12 +300,12 @@ <h3>第二步:使用标签</h3>
300300

301301
<div class="row">
302302
<div class="col-md-12">
303-
<!-- <h3>Deleting a service</h3> -->
304-
<h3>删除一个 Service</h3>
303+
<!-- <h3>Step 3: Deleting a service</h3> -->
304+
<h3>第三步:删除一个 Service</h3>
305305
<!--
306306
<p>To delete Services you can use the <code>delete service</code> subcommand. Labels can be used also here:</p>
307307
-->
308-
<p>要删除一个 Service 你可以使用 <code>delete service</code> 子命令。这里也可以使用标签:</p>
308+
<p>要删除一个 Service 你可以使用 <code>delete service</code> 子命令。这里也可以使用标签</p>
309309
<p><code><b>kubectl delete service -l app=kubernetes-bootcamp</b></code></p>
310310
<!--
311311
<p>Confirm that the Service is gone:</p>
@@ -340,7 +340,7 @@ <h3>删除一个 Service</h3>
340340
<p>
341341
准备好之后,继续学习<a href="/zh-cn/docs/tutorials/kubernetes-basics/scale/scale-intro/" title="运行应用的多个实例">运行应用的多个实例</a>
342342
</p>
343-
343+
344344
</div>
345345

346346
</div>

content/zh-cn/docs/tutorials/kubernetes-basics/scale/scale-intro.html

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ <h3>扩缩应用程序</h3>
5353
<p> <b> NOTE </b> If you are trying this after <a href="/docs/tutorials/kubernetes-basics/expose/expose-intro/">the previous section </a>, you may need to start from <a href="/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/">creating a cluster</a> as the services may have been deleted </p>
5454
-->
5555
<p><b>扩缩</b> 是通过改变 Deployment 中的副本数量来实现的。</p>
56-
<p> <b> 注意 </b> 如果你是在 <a href="/zh-cn/docs/tutorials/kubernetes-basics/expose/expose-intro/">上一节</a> 之后尝试此操作,
56+
<p> <b> 注意 </b> 如果你是在 <a href="/zh-cn/docs/tutorials/kubernetes-basics/expose/expose-intro/">上一节</a> 之后尝试此操作,
5757
你可能需要从 <a href="/zh-cn/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/">创建一个集群</a> 开始,
5858
因为 Service 可能已被删除。</p>
5959

6060
</div>
6161
<div class="col-md-4">
6262
<div class="content__box content__box_lined">
6363
<!-- <h3>Summary:</h3> -->
64-
<h3>小结:</h3>
64+
<h3>小结</h3>
6565
<ul>
6666
<!-- <li>Scaling a Deployment</li> -->
6767
<li>扩缩一个 Deployment</li>
@@ -269,6 +269,28 @@ <h3>负载均衡</h3>
269269
<p>We hit a different Pod with every request. This demonstrates that the load-balancing is working.</p>
270270
-->
271271
<p>我们每个请求都命中了不同的 Pod,这证明负载均衡正在工作。</p>
272+
{{< note >}}
273+
<!--
274+
<p>If you're running minikube with Docker Desktop as the container driver, a minikube tunnel is needed.
275+
This is because containers inside Docker Desktop are isolated from your host computer.<br>
276+
<p>In a separate terminal window, execute:<br>
277+
<code><b>minikube service kubernetes-bootcamp --url</b></code></p>
278+
-->
279+
<p>如果你使用 Docker Desktop 作为容器驱动程序运行 minikube,则需要 minikube 隧道。
280+
这是因为 Docker Desktop 内的容器与主机隔离。<br>
281+
<p>在单独的终端窗口中,执行:<br>
282+
<code><b>minikube service kubernetes-bootcamp --url</b></code></p>
283+
<!--
284+
<p>The output looks like this:
285+
<pre><b>http://127.0.0.1:51082<br>! Because you are using a Docker driver on darwin, the terminal needs to be open to run it.</b></pre></p>
286+
<p>Then use the given URL to access the app:<br>
287+
<code><b>curl 127.0.0.1:51082</b></code></p>
288+
-->
289+
<p>输出看起来像这样:
290+
<pre><b>http://127.0.0.1:51082<br>! Because you are using a Docker driver on darwin, the terminal needs to be open to run it.</b></pre></p>
291+
<p>然后使用给定的 URL 访问应用程序:
292+
<code><b>curl 127.0.0.1:51082</b></code></p>
293+
{{< /note >}}
272294
</div>
273295
</div>
274296

content/zh-cn/docs/tutorials/stateful-application/basic-stateful-set.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,11 @@ It creates a [headless Service](/docs/concepts/services-networking/service/#head
137137
{{% code_sample file="application/web/web.yaml" %}}
138138

139139
<!--
140-
Download the example above, and save it to a file named `web.yaml`
141-
-->
142-
下载上面的例子并保存为文件 `web.yaml`
143-
144-
<!--
145-
You will need to use two terminal windows. In the first terminal, use
140+
You will need to use at least two terminal windows. In the first terminal, use
146141
[`kubectl get`](/docs/reference/generated/kubectl/kubectl-commands/#get) to watch the creation
147142
of the StatefulSet's Pods.
148143
-->
149-
你需要使用两个终端窗口。在第一个终端中,使用
144+
你需要使用至少两个终端窗口。在第一个终端中,使用
150145
[`kubectl get`](/docs/reference/generated/kubectl/kubectl-commands/#get)
151146
来监视 StatefulSet 的 Pod 的创建情况。
152147

@@ -157,13 +152,13 @@ kubectl get pods -w -l app=nginx
157152
<!--
158153
In the second terminal, use
159154
[`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands/#apply) to create the
160-
headless Service and StatefulSet defined in `web.yaml`.
155+
headless Service and StatefulSet.
161156
-->
162157
在另一个终端中,使用 [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands/#apply)
163-
来创建定义在 `web.yaml` 中的 Headless Service 和 StatefulSet。
158+
来创建 Headless Service 和 StatefulSet。
164159

165160
```shell
166-
kubectl apply -f web.yaml
161+
kubectl apply -f https://k8s.io/examples/application/web/web.yaml
167162
```
168163
```
169164
service/nginx created
@@ -1229,7 +1224,7 @@ update.
12291224
<!--
12301225
The partition is currently set to `2`. Set the partition to `0`:
12311226
-->
1232-
分区当前为 `2`。请将分区设置为 `0`
1227+
分区当前为 `2`,请将其设置为 `0`
12331228

12341229
```shell
12351230
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"RollingUpdate","rollingUpdate":{"partition":0}}}}'
@@ -1415,7 +1410,7 @@ an error indicating that the Service already exists.
14151410
Service(你不应该这样做),你将会看到一个错误,提示 Service 已经存在。
14161411

14171412
```shell
1418-
kubectl apply -f web.yaml
1413+
kubectl apply -f https://k8s.io/examples/application/web/web.yaml
14191414
```
14201415
```
14211416
statefulset.apps/web created
@@ -1577,7 +1572,7 @@ Recreate the StatefulSet and headless Service one more time:
15771572
再一次重新创建 StatefulSet 和 Headless Service:
15781573

15791574
```shell
1580-
kubectl apply -f web.yaml
1575+
kubectl apply -f https://k8s.io/examples/application/web/web.yaml
15811576
```
15821577

15831578
```
@@ -1679,11 +1674,6 @@ Pod. This option only affects the behavior for scaling operations. Updates are n
16791674

16801675
{{{% code_sample file="application/web/web-parallel.yaml" %}}
16811676

1682-
<!--
1683-
Download the example above, and save it to a file named `web-parallel.yaml`
1684-
-->
1685-
下载上面的例子并保存为 `web-parallel.yaml`
1686-
16871677
<!--
16881678
This manifest is identical to the one you downloaded above except that the `.spec.podManagementPolicy`
16891679
of the `web` StatefulSet is set to `Parallel`.
@@ -1706,7 +1696,7 @@ In another terminal, create the StatefulSet and Service in the manifest:
17061696
在另一个终端窗口创建清单中的 StatefulSet 和 Service:
17071697

17081698
```shell
1709-
kubectl apply -f web-parallel.yaml
1699+
kubectl apply -f https://k8s.io/examples/application/web/web-parallel.yaml
17101700
```
17111701
```
17121702
service/nginx created

0 commit comments

Comments
 (0)