ZH-trans: update basic-stateful-set.md (#13178)

* Update basic-stateful-set.md

* Update basic-stateful-set.md

* Update basic-stateful-set.md

* Update basic-stateful-set.md

* Update basic-stateful-set.md
pull/13237/head
lIuDuI 2019-03-18 09:59:10 +08:00 committed by Kubernetes Prow Robot
parent ed7f0adc74
commit 5115d4fa7d
1 changed files with 9 additions and 5 deletions

View File

@ -6,7 +6,7 @@ approvers:
- janetkuo
- kow3ns
- smarterclayton
title: StatefulSet基本使用
title: StatefulSet 基本使用
content_template: templates/tutorial
---
@ -20,7 +20,7 @@ content_template: templates/tutorial
在开始本教程之前,你应该熟悉以下 Kubernetes 的概念:
* [Pods](/docs/user-guide/pods/single-container/)
* [Cluster DNS](/docs/concepts/services-networking/dns-pod-service/)
* [集群 DNS](/docs/concepts/services-networking/dns-pod-service/)
* [Headless Services](/docs/concepts/services-networking/service/#headless-services)
* [PersistentVolumes](/docs/concepts/storage/volumes/)
* [PersistentVolume Provisioning](http://releases.k8s.io/{{< param "githubbranch" >}}/examples/persistent-volume-provisioning/)
@ -46,10 +46,10 @@ StatefulSets 旨在与有状态的应用及分布式系统一起使用。然而
{{% capture lessoncontent %}}
##创建 StatefulSet
## 创建 StatefulSet
作为开始,使用如下示例创建一个 StatefulSet。它和 [StatefulSets](/docs/concepts/abstractions/controllers/statefulsets/) 概念中的示例相似。它创建了一个 [Headless Service](/docs/user-guide/services/#headless-services) `nginx` 用来发布StatefulSet `web` 中的 Pod 的 IP 地址。
作为开始,使用如下示例创建一个 StatefulSet。它和 [StatefulSets](/docs/concepts/abstractions/controllers/statefulsets/) 概念中的示例相似。它创建了一个 [Headless Service](/docs/user-guide/services/#headless-services) `nginx` 用来发布 StatefulSet `web` 中的 Pod 的 IP 地址。
{{< code file="web.yaml" >}}
@ -131,7 +131,7 @@ web-1 1/1 Running 0 1m
```
如同 [StatefulSets](/docs/concepts/abstractions/controllers/statefulsets/) 概念中所提到的, StatefulSet 中的 Pod 拥有一个具有黏性的、独一无二的身份标志。这个标志基于 StatefulSet 控制器分配给每个 Pod 的唯一顺序索引。 Pod 的名称的形式为`<statefulset name>-<ordinal index>`。`web` StatefulSet 拥有两个副本,所以它创建了两个 Pod`web-0`和`web-1`。
如同 [StatefulSets](/docs/concepts/abstractions/controllers/statefulsets/) 概念中所提到的, StatefulSet 中的 Pod 拥有一个具有黏性的、独一无二的身份标志。这个标志基于 StatefulSet 控制器分配给每个 Pod 的唯一顺序索引。 Pod 的名称的形式为 `<statefulset name>-<ordinal index>`。`web` StatefulSet 拥有两个副本,所以它创建了两个 Pod`web-0` `web-1`
### 使用稳定的网络身份标识
@ -451,6 +451,7 @@ pod "web-0" deleted
<--
Watch the `web-0` Pod, and wait for it to transition to Running and Ready.
-->
观察 `web-0` Pod 等待它变成 Running 和 Ready。
```shell
@ -477,8 +478,11 @@ web-1 k8s.gcr.io/nginx-slim:0.8
web-2 k8s.gcr.io/nginx-slim:0.8
```
<!--
`web-0` has had its image updated, but `web-0` and `web-1` still have the original
image. Complete the update by deleting the remaining Pods.
-->
`web-0` 已经更新了它的镜像,但是 `web-1``web-2` 仍保留了原始镜像。
```shell
kubectl delete pod web-1 web-2