Skip to content

Commit 7a86c9d

Browse files
committed
[zh-cn] sync tutorials/stateful-application/*
Signed-off-by: xin.li <[email protected]>
1 parent 98ea70d commit 7a86c9d

File tree

4 files changed

+74
-46
lines changed

4 files changed

+74
-46
lines changed

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

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ It creates a [headless Service](/docs/concepts/services-networking/service/#head
114114
它创建了一个 [Headless Service](/zh-cn/docs/concepts/services-networking/service/#headless-services)
115115
`nginx` 用来发布 StatefulSet `web` 中的 Pod 的 IP 地址。
116116

117-
{{< codenew file="application/web/web.yaml" >}}
117+
{{% code_sample file="application/web/web.yaml" %}}
118118

119119
<!--
120120
Download the example above, and save it to a file named `web.yaml`
@@ -237,7 +237,7 @@ Pods in a StatefulSet have a unique ordinal index and a stable network identity.
237237
StatefulSet 中的每个 Pod 拥有一个唯一的顺序索引和稳定的网络身份标识。
238238

239239
<!--
240-
### Examining the Pod's Ordinal Index
240+
### Examining the Pod's ordinal Index
241241
-->
242242
### 检查 Pod 的顺序索引 {#examining-the-pod-s-ordinal-index}
243243

@@ -272,7 +272,7 @@ Pod 名称的格式为 `<statefulset 名称>-<序号索引>`。
272272
`web` StatefulSet 拥有两个副本,所以它创建了两个 Pod:`web-0``web-1`
273273

274274
<!--
275-
### Using Stable Network Identities
275+
### Using Stable network Identities
276276
-->
277277
### 使用稳定的网络身份标识 {#using-stable-network-identities}
278278

@@ -347,7 +347,7 @@ The CNAME of the headless service points to SRV records (one for each Pod that
347347
is Running and Ready). The SRV records point to A record entries that
348348
contain the Pods' IP addresses.
349349
-->
350-
headless service 的 CNAME 指向 SRV 记录(记录每个 Running 和 Ready 状态的 Pod)。
350+
Headless service 的 CNAME 指向 SRV 记录(记录每个 Running 和 Ready 状态的 Pod)。
351351
SRV 记录指向一个包含 Pod IP 地址的记录表项。
352352

353353
<!--
@@ -466,6 +466,11 @@ Pod 的序号、主机名、SRV 条目和记录名称没有改变,但和 Pod
466466
在本教程中使用的集群中它们就改变了。这就是为什么不要在其他应用中使用
467467
StatefulSet 中 Pod 的 IP 地址进行连接,这点很重要。
468468

469+
<!--
470+
#### Discovery for specific Pods in a StatefulSet
471+
-->
472+
#### 发现 StatefulSet 中特定的 Pod {#discovery-for-specific-pods-in-a-statefulset}
473+
469474
<!--
470475
If you need to find and connect to the active members of a StatefulSet, you
471476
should query the CNAME of the headless Service
@@ -490,7 +495,7 @@ to Running and Ready.
490495
Pod 的状态变为 Running 和 Ready 时,你的应用就能够发现它们的地址。
491496

492497
<!--
493-
### Writing to Stable Storage
498+
### Writing to stable Storage
494499
-->
495500
### 写入稳定的存储 {#writing-to-stable-storage}
496501

@@ -659,7 +664,7 @@ This is accomplished by updating the `replicas` field. You can use either
659664
或者 [`kubectl patch`](/docs/reference/generated/kubectl/kubectl-commands/#patch) 来扩容/缩容一个 StatefulSet。
660665

661666
<!--
662-
### Scaling Up
667+
### Scaling up
663668
-->
664669
### 扩容 {#scaling-up}
665670

@@ -775,7 +780,7 @@ web-3 1/1 Terminating 0 42s
775780
```
776781

777782
<!--
778-
### Ordered Pod Termination
783+
### Ordered Pod termination
779784
-->
780785
### 顺序终止 Pod {#ordered-pod-termination}
781786

@@ -805,7 +810,9 @@ www-web-4 Bound pvc-e11bb5f8-b508-11e6-932f-42010a800002 1Gi RWO
805810

806811
<!--
807812
There are still five PersistentVolumeClaims and five PersistentVolumes.
808-
When exploring a Pod's [stable storage](#writing-to-stable-storage), we saw that the PersistentVolumes mounted to the Pods of a StatefulSet are not deleted when the StatefulSet's Pods are deleted. This is still true when Pod deletion is caused by scaling the StatefulSet down.
813+
When exploring a Pod's [stable storage](#writing-to-stable-storage), we saw that the PersistentVolumes
814+
mounted to the Pods of a StatefulSet are not deleted when the StatefulSet's Pods are deleted.
815+
This is still true when Pod deletion is caused by scaling the StatefulSet down.
809816
-->
810817
五个 PersistentVolumeClaims 和五个 PersistentVolume 卷仍然存在。
811818
查看 Pod 的[稳定存储](#stable-storage),我们发现当删除 StatefulSet 的
@@ -835,7 +842,7 @@ StatefulSet 中 Pod 的的容器镜像、资源请求和限制、标签和注解
835842
`RollingUpdate` 更新策略是 StatefulSet 默认策略。
836843

837844
<!--
838-
### Rolling Update
845+
### RollingUpdate {#rolling-update}
839846
-->
840847
### 滚动更新 {#rolling-update}
841848

@@ -971,7 +978,7 @@ StatefulSet 的滚动更新状态。
971978
{{< /note >}}
972979

973980
<!--
974-
#### Staging an Update
981+
#### Staging an update
975982
-->
976983
#### 分段更新 {#staging-an-update}
977984

@@ -1059,7 +1066,7 @@ ordinal of the Pod is less than the `partition` specified by the
10591066
这是因为 Pod 的序号比 `updateStrategy` 指定的 `partition` 更小。
10601067

10611068
<!--
1062-
#### Rolling Out a Canary
1069+
#### Rolling Out a canary
10631070
-->
10641071
#### 金丝雀发布 {#rolling-out-a-canary}
10651072

@@ -1184,7 +1191,7 @@ StatefulSet 的 `.spec.template`,则所有序号大于或等于分区的 Pod
11841191
如果一个序号小于分区的 Pod 被删除或者终止,它将被按照原来的配置恢复。
11851192

11861193
<!--
1187-
#### Phased Roll Outs
1194+
#### Phased Roll outs
11881195
-->
11891196
#### 分阶段的发布 {#phased-roll-outs}
11901197

@@ -1264,7 +1271,7 @@ continue the update process.
12641271
`partition` 改变为 `0` 以允许 StatefulSet 继续更新过程。
12651272

12661273
<!--
1267-
### On Delete
1274+
### OnDelete {#on-delete}
12681275
-->
12691276
### OnDelete 策略 {#on-delete}
12701277

@@ -1292,7 +1299,7 @@ StatefulSet 同时支持级联和非级联删除。使用非级联方式删除 S
12921299
的 Pod 不会被删除。使用级联删除时,StatefulSet 和它的 Pod 都会被删除。
12931300

12941301
<!--
1295-
### Non-Cascading Delete
1302+
### Non-cascading delete
12961303
-->
12971304
### 非级联删除 {#non-cascading-delete}
12981305

@@ -1399,7 +1406,7 @@ service/nginx unchanged
13991406
Ignore the error. It only indicates that an attempt was made to create the _nginx_
14001407
headless Service even though that Service already exists.
14011408
-->
1402-
请忽略这个错误。它仅表示 kubernetes 进行了一次创建 **nginx** headless Service
1409+
请忽略这个错误。它仅表示 kubernetes 进行了一次创建 **nginx** Headless Service
14031410
的尝试,尽管那个 Service 已经存在。
14041411

14051412
<!--
@@ -1465,7 +1472,7 @@ PersistentVolume was remounted.
14651472
当你重建这个 StatefulSet 并且重新启动了 `web-0` 时,它原本的 PersistentVolume 卷会被重新挂载。
14661473

14671474
<!--
1468-
### Cascading Delete
1475+
### Cascading delete
14691476
-->
14701477
### 级联删除 {#cascading-delete}
14711478

@@ -1482,7 +1489,7 @@ kubectl get pods -w -l app=nginx
14821489
In another terminal, delete the StatefulSet again. This time, omit the
14831490
`--cascade=orphan` parameter.
14841491
-->
1485-
在另一个窗口中再次删除这个 StatefulSet这次省略 `--cascade=orphan` 参数。
1492+
在另一个窗口中再次删除这个 StatefulSet这次省略 `--cascade=orphan` 参数。
14861493

14871494
```shell
14881495
kubectl delete statefulset web
@@ -1547,7 +1554,7 @@ service "nginx" deleted
15471554
<!--
15481555
Recreate the StatefulSet and headless Service one more time:
15491556
-->
1550-
再一次重新创建 StatefulSet 和 headless Service:
1557+
再一次重新创建 StatefulSet 和 Headless Service:
15511558

15521559
```shell
15531560
kubectl apply -f web.yaml
@@ -1584,7 +1591,7 @@ PersistentVolume 卷,并且 `web-0` 和 `web-1` 将继续使用它的主机名
15841591
<!--
15851592
Finally, delete the `nginx` Service...
15861593
-->
1587-
最后删除 `nginx` service
1594+
最后删除 `nginx` Service:
15881595

15891596
```shell
15901597
kubectl delete service nginx
@@ -1597,7 +1604,7 @@ service "nginx" deleted
15971604
<!--
15981605
...and the `web` StatefulSet:
15991606
-->
1600-
并且删除 `web` StatefulSet:
1607+
并且删除 `web` StatefulSet
16011608

16021609
```shell
16031610
kubectl delete statefulset web
@@ -1608,7 +1615,7 @@ statefulset "web" deleted
16081615
```
16091616

16101617
<!--
1611-
## Pod Management Policy
1618+
## Pod Management policy
16121619
-->
16131620
## Pod 管理策略 {#pod-management-policy}
16141621

@@ -1619,12 +1626,12 @@ identity. To address this, in Kubernetes 1.7, we introduced
16191626
`.spec.podManagementPolicy` to the StatefulSet API Object.
16201627
-->
16211628
对于某些分布式系统来说,StatefulSet 的顺序性保证是不必要和/或者不应该的。
1622-
这些系统仅仅要求唯一性和身份标志。为了解决这个问题,在 Kubernetes 1.7
1623-
我们针对 StatefulSet API 对象引入了 `.spec.podManagementPolicy`
1629+
这些系统仅仅要求唯一性和身份标志。为了解决这个问题,在 Kubernetes 1.7
1630+
中我们针对 StatefulSet API 对象引入了 `.spec.podManagementPolicy`
16241631
此选项仅影响扩缩操作的行为。更新不受影响。
16251632

16261633
<!--
1627-
### OrderedReady Pod Management
1634+
### OrderedReady Pod management
16281635
-->
16291636
### OrderedReady Pod 管理策略 {#orderedready-pod-management}
16301637

@@ -1637,7 +1644,7 @@ above.
16371644
StatefulSet 控制器遵循上文展示的顺序性保证。
16381645

16391646
<!--
1640-
### Parallel Pod Management
1647+
### Parallel Pod management
16411648
-->
16421649
### Parallel Pod 管理策略 {#parallel-pod-management}
16431650

@@ -1650,7 +1657,7 @@ Pod. This option only affects the behavior for scaling operations. Updates are n
16501657
`Parallel` Pod 管理策略告诉 StatefulSet 控制器并行的终止所有 Pod,
16511658
在启动或终止另一个 Pod 前,不必等待这些 Pod 变成 Running 和 Ready 或者完全终止状态。
16521659

1653-
{{< codenew file="application/web/web-parallel.yaml" >}}
1660+
{{{% code_sample file="application/web/web-parallel.yaml" %}}
16541661

16551662
<!--
16561663
Download the example above, and save it to a file named `web-parallel.yaml`
@@ -1760,7 +1767,7 @@ kubectl delete sts web
17601767
<!--
17611768
You can watch `kubectl get` to see those Pods being deleted.
17621769
-->
1763-
你可以监视 `kubectl get` 来查看那些 Pod 被删除
1770+
你可以监视 `kubectl get` 来查看那些 Pod 被删除
17641771

17651772
```shell
17661773
kubectl get pod -l app=nginx -w
@@ -1812,7 +1819,8 @@ kubectl delete svc nginx
18121819
Delete the persistent storage media for the PersistentVolumes used in this tutorial.
18131820
-->
18141821

1815-
删除本教程中用到的 PersistentVolume 卷的持久化存储介质。
1822+
删除本教程中用到的 PersistentVolume 卷的持久化存储介质:
1823+
18161824
```shell
18171825
kubectl get pvc
18181826
```

content/zh-cn/docs/tutorials/stateful-application/cassandra.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Create a Service to track all Cassandra StatefulSet members from the `cassandra-
123123

124124
以下 Service 用于在 Cassandra Pod 和集群中的客户端之间进行 DNS 查找:
125125

126-
{{< codenew file="application/cassandra/cassandra-service.yaml" >}}
126+
{{% code_sample file="application/cassandra/cassandra-service.yaml" %}}
127127

128128
创建一个 Service 来跟踪 `cassandra-service.yaml` 文件中的所有 Cassandra StatefulSet:
129129

@@ -181,7 +181,7 @@ Please update the following StatefulSet for the cloud you are working with.
181181
请为正在使用的云更新以下 StatefulSet。
182182
{{< /note >}}
183183

184-
{{< codenew file="application/cassandra/cassandra-statefulset.yaml" >}}
184+
{{% code_sample file="application/cassandra/cassandra-statefulset.yaml" %}}
185185

186186
<!--
187187
Create the Cassandra StatefulSet from the `cassandra-statefulset.yaml` file:
@@ -438,6 +438,6 @@ By using environment variables you can change values that are inserted into `cas
438438
* See more custom [Seed Provider Configurations](https://git.k8s.io/examples/cassandra/java/README.md)
439439
-->
440440
* 了解如何[扩缩 StatefulSet](/docs/tasks/run-application/scale-stateful-set/)
441-
* 了解有关 [*KubernetesSeedProvider*](https://github.com/kubernetes/examples/blob/master/cassandra/java/src/main/java/io/k8s/cassandra/KubernetesSeedProvider.java) 的更多信息
441+
* 了解有关 [**KubernetesSeedProvider**](https://github.com/kubernetes/examples/blob/master/cassandra/java/src/main/java/io/k8s/cassandra/KubernetesSeedProvider.java) 的更多信息
442442
* 查看更多自定义 [Seed Provider Configurations](https://git.k8s.io/examples/cassandra/java/README.md)
443443

content/zh-cn/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ environment variable sets the database password from the Secret.
211211
以下清单文件描述的是一个单实例的 MySQL Deployment。MySQL 容器将 PersistentVolume 挂载在 `/var/lib/mysql`
212212
`MYSQL_ROOT_PASSWORD` 环境变量根据 Secret 设置数据库密码。
213213

214-
{{< codenew file="application/wordpress/mysql-deployment.yaml" >}}
214+
{{% code_sample file="application/wordpress/mysql-deployment.yaml" %}}
215215

216216
<!--
217217
The following manifest describes a single-instance WordPress Deployment. The WordPress container mounts the
@@ -224,7 +224,7 @@ the name of the MySQL Service defined above, and WordPress will access the datab
224224
`WORDPRESS_DB_HOST` 环境变量设置上面定义的 MySQL Service 的名称,WordPress 将通过 Service 访问数据库。
225225
`WORDPRESS_DB_PASSWORD` 环境变量根据使用 kustomize 生成的 Secret 设置数据库密码。
226226

227-
{{< codenew file="application/wordpress/wordpress-deployment.yaml" >}}
227+
{{% code_sample file="application/wordpress/wordpress-deployment.yaml" %}}
228228

229229
<!--
230230
1. Download the MySQL deployment configuration file.

0 commit comments

Comments
 (0)