@@ -114,7 +114,7 @@ It creates a [headless Service](/docs/concepts/services-networking/service/#head
114
114
它创建了一个 [ Headless Service] ( /zh-cn/docs/concepts/services-networking/service/#headless-services )
115
115
` nginx ` 用来发布 StatefulSet ` web ` 中的 Pod 的 IP 地址。
116
116
117
- {{< codenew file="application/web/web.yaml" > }}
117
+ {{% code_sample file="application/web/web.yaml" % }}
118
118
119
119
<!--
120
120
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.
237
237
StatefulSet 中的每个 Pod 拥有一个唯一的顺序索引和稳定的网络身份标识。
238
238
239
239
<!--
240
- ### Examining the Pod's Ordinal Index
240
+ ### Examining the Pod's ordinal Index
241
241
-->
242
242
### 检查 Pod 的顺序索引 {#examining-the-pod-s-ordinal-index}
243
243
@@ -272,7 +272,7 @@ Pod 名称的格式为 `<statefulset 名称>-<序号索引>`。
272
272
` web ` StatefulSet 拥有两个副本,所以它创建了两个 Pod:` web-0 ` 和 ` web-1 ` 。
273
273
274
274
<!--
275
- ### Using Stable Network Identities
275
+ ### Using Stable network Identities
276
276
-->
277
277
### 使用稳定的网络身份标识 {#using-stable-network-identities}
278
278
@@ -347,7 +347,7 @@ The CNAME of the headless service points to SRV records (one for each Pod that
347
347
is Running and Ready). The SRV records point to A record entries that
348
348
contain the Pods' IP addresses.
349
349
-->
350
- headless service 的 CNAME 指向 SRV 记录(记录每个 Running 和 Ready 状态的 Pod)。
350
+ Headless service 的 CNAME 指向 SRV 记录(记录每个 Running 和 Ready 状态的 Pod)。
351
351
SRV 记录指向一个包含 Pod IP 地址的记录表项。
352
352
353
353
<!--
@@ -466,6 +466,11 @@ Pod 的序号、主机名、SRV 条目和记录名称没有改变,但和 Pod
466
466
在本教程中使用的集群中它们就改变了。这就是为什么不要在其他应用中使用
467
467
StatefulSet 中 Pod 的 IP 地址进行连接,这点很重要。
468
468
469
+ <!--
470
+ #### Discovery for specific Pods in a StatefulSet
471
+ -->
472
+ #### 发现 StatefulSet 中特定的 Pod {#discovery-for-specific-pods-in-a-statefulset}
473
+
469
474
<!--
470
475
If you need to find and connect to the active members of a StatefulSet, you
471
476
should query the CNAME of the headless Service
@@ -490,7 +495,7 @@ to Running and Ready.
490
495
Pod 的状态变为 Running 和 Ready 时,你的应用就能够发现它们的地址。
491
496
492
497
<!--
493
- ### Writing to Stable Storage
498
+ ### Writing to stable Storage
494
499
-->
495
500
### 写入稳定的存储 {#writing-to-stable-storage}
496
501
@@ -659,7 +664,7 @@ This is accomplished by updating the `replicas` field. You can use either
659
664
或者 [ ` kubectl patch ` ] ( /docs/reference/generated/kubectl/kubectl-commands/#patch ) 来扩容/缩容一个 StatefulSet。
660
665
661
666
<!--
662
- ### Scaling Up
667
+ ### Scaling up
663
668
-->
664
669
### 扩容 {#scaling-up}
665
670
@@ -775,7 +780,7 @@ web-3 1/1 Terminating 0 42s
775
780
```
776
781
777
782
<!--
778
- ### Ordered Pod Termination
783
+ ### Ordered Pod termination
779
784
-->
780
785
### 顺序终止 Pod {#ordered-pod-termination}
781
786
@@ -805,7 +810,9 @@ www-web-4 Bound pvc-e11bb5f8-b508-11e6-932f-42010a800002 1Gi RWO
805
810
806
811
<!--
807
812
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.
809
816
-->
810
817
五个 PersistentVolumeClaims 和五个 PersistentVolume 卷仍然存在。
811
818
查看 Pod 的[ 稳定存储] ( #stable-storage ) ,我们发现当删除 StatefulSet 的
@@ -835,7 +842,7 @@ StatefulSet 中 Pod 的的容器镜像、资源请求和限制、标签和注解
835
842
` RollingUpdate ` 更新策略是 StatefulSet 默认策略。
836
843
837
844
<!--
838
- ### Rolling Update
845
+ ### RollingUpdate {#rolling-update}
839
846
-->
840
847
### 滚动更新 {#rolling-update}
841
848
@@ -971,7 +978,7 @@ StatefulSet 的滚动更新状态。
971
978
{{< /note >}}
972
979
973
980
<!--
974
- #### Staging an Update
981
+ #### Staging an update
975
982
-->
976
983
#### 分段更新 {#staging-an-update}
977
984
@@ -1059,7 +1066,7 @@ ordinal of the Pod is less than the `partition` specified by the
1059
1066
这是因为 Pod 的序号比 ` updateStrategy ` 指定的 ` partition ` 更小。
1060
1067
1061
1068
<!--
1062
- #### Rolling Out a Canary
1069
+ #### Rolling Out a canary
1063
1070
-->
1064
1071
#### 金丝雀发布 {#rolling-out-a-canary}
1065
1072
@@ -1184,7 +1191,7 @@ StatefulSet 的 `.spec.template`,则所有序号大于或等于分区的 Pod
1184
1191
如果一个序号小于分区的 Pod 被删除或者终止,它将被按照原来的配置恢复。
1185
1192
1186
1193
<!--
1187
- #### Phased Roll Outs
1194
+ #### Phased Roll outs
1188
1195
-->
1189
1196
#### 分阶段的发布 {#phased-roll-outs}
1190
1197
@@ -1264,7 +1271,7 @@ continue the update process.
1264
1271
将 ` partition ` 改变为 ` 0 ` 以允许 StatefulSet 继续更新过程。
1265
1272
1266
1273
<!--
1267
- ### On Delete
1274
+ ### OnDelete {#on-delete}
1268
1275
-->
1269
1276
### OnDelete 策略 {#on-delete}
1270
1277
@@ -1292,7 +1299,7 @@ StatefulSet 同时支持级联和非级联删除。使用非级联方式删除 S
1292
1299
的 Pod 不会被删除。使用级联删除时,StatefulSet 和它的 Pod 都会被删除。
1293
1300
1294
1301
<!--
1295
- ### Non-Cascading Delete
1302
+ ### Non-cascading delete
1296
1303
-->
1297
1304
### 非级联删除 {#non-cascading-delete}
1298
1305
@@ -1399,7 +1406,7 @@ service/nginx unchanged
1399
1406
Ignore the error. It only indicates that an attempt was made to create the _nginx_
1400
1407
headless Service even though that Service already exists.
1401
1408
-->
1402
- 请忽略这个错误。它仅表示 kubernetes 进行了一次创建 ** nginx** headless Service
1409
+ 请忽略这个错误。它仅表示 kubernetes 进行了一次创建 ** nginx** Headless Service
1403
1410
的尝试,尽管那个 Service 已经存在。
1404
1411
1405
1412
<!--
@@ -1465,7 +1472,7 @@ PersistentVolume was remounted.
1465
1472
当你重建这个 StatefulSet 并且重新启动了 ` web-0 ` 时,它原本的 PersistentVolume 卷会被重新挂载。
1466
1473
1467
1474
<!--
1468
- ### Cascading Delete
1475
+ ### Cascading delete
1469
1476
-->
1470
1477
### 级联删除 {#cascading-delete}
1471
1478
@@ -1482,7 +1489,7 @@ kubectl get pods -w -l app=nginx
1482
1489
In another terminal, delete the StatefulSet again. This time, omit the
1483
1490
`--cascade=orphan` parameter.
1484
1491
-->
1485
- 在另一个窗口中再次删除这个 StatefulSet。 这次省略 ` --cascade=orphan ` 参数。
1492
+ 在另一个窗口中再次删除这个 StatefulSet, 这次省略 ` --cascade=orphan ` 参数。
1486
1493
1487
1494
``` shell
1488
1495
kubectl delete statefulset web
@@ -1547,7 +1554,7 @@ service "nginx" deleted
1547
1554
<!--
1548
1555
Recreate the StatefulSet and headless Service one more time:
1549
1556
-->
1550
- 再一次重新创建 StatefulSet 和 headless Service:
1557
+ 再一次重新创建 StatefulSet 和 Headless Service:
1551
1558
1552
1559
``` shell
1553
1560
kubectl apply -f web.yaml
@@ -1584,7 +1591,7 @@ PersistentVolume 卷,并且 `web-0` 和 `web-1` 将继续使用它的主机名
1584
1591
<!--
1585
1592
Finally, delete the `nginx` Service...
1586
1593
-->
1587
- 最后删除 ` nginx ` service
1594
+ 最后删除 ` nginx ` Service:
1588
1595
1589
1596
``` shell
1590
1597
kubectl delete service nginx
@@ -1597,7 +1604,7 @@ service "nginx" deleted
1597
1604
<!--
1598
1605
...and the `web` StatefulSet:
1599
1606
-->
1600
- 并且删除 ` web ` StatefulSet:
1607
+ 并且删除 ` web ` StatefulSet:
1601
1608
1602
1609
``` shell
1603
1610
kubectl delete statefulset web
@@ -1608,7 +1615,7 @@ statefulset "web" deleted
1608
1615
```
1609
1616
1610
1617
<!--
1611
- ## Pod Management Policy
1618
+ ## Pod Management policy
1612
1619
-->
1613
1620
## Pod 管理策略 {#pod-management-policy}
1614
1621
@@ -1619,12 +1626,12 @@ identity. To address this, in Kubernetes 1.7, we introduced
1619
1626
`.spec.podManagementPolicy` to the StatefulSet API Object.
1620
1627
-->
1621
1628
对于某些分布式系统来说,StatefulSet 的顺序性保证是不必要和/或者不应该的。
1622
- 这些系统仅仅要求唯一性和身份标志。为了解决这个问题,在 Kubernetes 1.7 中
1623
- 我们针对 StatefulSet API 对象引入了 ` .spec.podManagementPolicy ` 。
1629
+ 这些系统仅仅要求唯一性和身份标志。为了解决这个问题,在 Kubernetes 1.7
1630
+ 中我们针对 StatefulSet API 对象引入了 ` .spec.podManagementPolicy ` 。
1624
1631
此选项仅影响扩缩操作的行为。更新不受影响。
1625
1632
1626
1633
<!--
1627
- ### OrderedReady Pod Management
1634
+ ### OrderedReady Pod management
1628
1635
-->
1629
1636
### OrderedReady Pod 管理策略 {#orderedready-pod-management}
1630
1637
@@ -1637,7 +1644,7 @@ above.
1637
1644
StatefulSet 控制器遵循上文展示的顺序性保证。
1638
1645
1639
1646
<!--
1640
- ### Parallel Pod Management
1647
+ ### Parallel Pod management
1641
1648
-->
1642
1649
### Parallel Pod 管理策略 {#parallel-pod-management}
1643
1650
@@ -1650,7 +1657,7 @@ Pod. This option only affects the behavior for scaling operations. Updates are n
1650
1657
` Parallel ` Pod 管理策略告诉 StatefulSet 控制器并行的终止所有 Pod,
1651
1658
在启动或终止另一个 Pod 前,不必等待这些 Pod 变成 Running 和 Ready 或者完全终止状态。
1652
1659
1653
- {{< codenew file="application/web/web-parallel.yaml" > }}
1660
+ {{{% code_sample file="application/web/web-parallel.yaml" % }}
1654
1661
1655
1662
<!--
1656
1663
Download the example above, and save it to a file named `web-parallel.yaml`
@@ -1760,7 +1767,7 @@ kubectl delete sts web
1760
1767
<!--
1761
1768
You can watch `kubectl get` to see those Pods being deleted.
1762
1769
-->
1763
- 你可以监视 ` kubectl get ` 来查看那些 Pod 被删除
1770
+ 你可以监视 ` kubectl get ` 来查看那些 Pod 被删除:
1764
1771
1765
1772
``` shell
1766
1773
kubectl get pod -l app=nginx -w
@@ -1812,7 +1819,8 @@ kubectl delete svc nginx
1812
1819
Delete the persistent storage media for the PersistentVolumes used in this tutorial.
1813
1820
-->
1814
1821
1815
- 删除本教程中用到的 PersistentVolume 卷的持久化存储介质。
1822
+ 删除本教程中用到的 PersistentVolume 卷的持久化存储介质:
1823
+
1816
1824
``` shell
1817
1825
kubectl get pvc
1818
1826
```
0 commit comments