Skip to content

Commit ee82265

Browse files
authored
Merge pull request #36859 from windsonsea/conpvs
[zh]Sync configure-persistent-volume-storage.md
2 parents 4833db9 + f4d02e1 commit ee82265

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

content/zh-cn/docs/tasks/configure-pod-container/configure-persistent-volume-storage.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ PersistentVolume.
2727
2828
1. You create a Pod that uses the above PersistentVolumeClaim for storage.
2929
-->
30-
本文将向你介绍如何配置 Pod 使用
30+
本文将向你介绍如何配置 Pod 使用
3131
{{< glossary_tooltip text="PersistentVolumeClaim" term_id="persistent-volume-claim" >}}
3232
作为存储。
3333
以下是该过程的总结:
3434

35-
1. 你作为集群管理员创建由物理存储支持的 PersistentVolume。你不会将卷与任何 Pod 关联。
35+
1. 你作为集群管理员创建由物理存储支持的 PersistentVolume。你不会将该卷与任何 Pod 关联。
3636

3737
1. 你现在以开发人员或者集群用户的角色创建一个 PersistentVolumeClaim,
3838
它将自动绑定到合适的 PersistentVolume。
3939

40-
1. 你创建一个使用 PersistentVolumeClaim 作为存储的 Pod。
40+
1. 你创建一个使用以上 PersistentVolumeClaim 作为存储的 Pod。
4141

4242
## {{% heading "prerequisites" %}}
4343

@@ -56,8 +56,8 @@ do not already have a single-node cluster, you can create one by using
5656
{{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 命令行工具以便与集群交互。
5757
如果还没有单节点集群,可以使用
5858
[Minikube](https://minikube.sigs.k8s.io/docs/) 创建一个。
59-
.
60-
* 熟悉[持久卷](/zh-cn/docs/concepts/storage/persistent-volumes/)中的材料
59+
60+
* 熟悉[持久卷](/zh-cn/docs/concepts/storage/persistent-volumes/)文档
6161

6262
<!-- steps -->
6363

@@ -70,7 +70,7 @@ can open a shell to your Node by entering `minikube ssh`.
7070
7171
In your shell on that Node, create a `/mnt/data` directory:
7272
-->
73-
## 在你的节点上创建一个 index.html 文件
73+
## 在你的节点上创建一个 index.html 文件 {#create-an-index-file-on-your-node}
7474

7575
打开集群中的某个节点的 Shell。
7676
如何打开 Shell 取决于集群的设置。
@@ -106,8 +106,7 @@ If your Node uses a tool for superuser access other than `sudo`, you can
106106
usually make this work if you replace `sudo` with the name of the other tool.
107107
-->
108108
{{< note >}}
109-
如果你的节点使用某工具而不是 `sudo` 来完成超级用户访问,你可以将上述命令
110-
中的 `sudo` 替换为该工具的名称。
109+
如果你的节点使用某工具而不是 `sudo` 来完成超级用户访问,你可以将上述命令中的 `sudo` 替换为该工具的名称。
111110
{{< /note >}}
112111

113112
<!--
@@ -118,6 +117,7 @@ Test that the `index.html` file exists:
118117
```shell
119118
cat /mnt/data/index.html
120119
```
120+
121121
<!--
122122
The output should be:
123123
-->
@@ -139,7 +139,7 @@ In this exercise, you create a *hostPath* PersistentVolume. Kubernetes supports
139139
hostPath for development and testing on a single-node cluster. A hostPath
140140
PersistentVolume uses a file or directory on the Node to emulate network-attached storage.
141141
-->
142-
## 创建 PersistentVolume
142+
## 创建 PersistentVolume {#create-a-pv}
143143

144144
在本练习中,你将创建一个 **hostPath** 类型的 PersistentVolume。
145145
Kubernetes 支持用于在单节点集群上开发和测试的 hostPath 类型的 PersistentVolume。
@@ -149,7 +149,7 @@ hostPath 类型的 PersistentVolume 使用节点上的文件或目录来模拟
149149
In a production cluster, you would not use hostPath. Instead a cluster administrator
150150
would provision a network resource like a Google Compute Engine persistent disk,
151151
an NFS share, or an Amazon Elastic Block Store volume. Cluster administrators can also
152-
use [StorageClasses](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage)
152+
use [StorageClasses](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage-k8s-io)
153153
to set up
154154
[dynamic provisioning](/blog/2016/10/dynamic-provisioning-and-storage-in-kubernetes).
155155
@@ -158,7 +158,7 @@ Here is the configuration file for the hostPath PersistentVolume:
158158
在生产集群中,你不会使用 hostPath。
159159
集群管理员会提供网络存储资源,比如 Google Compute Engine 持久盘卷、NFS 共享卷或 Amazon Elastic Block Store 卷。
160160
集群管理员还可以使用
161-
[StorageClasses](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage)
161+
[StorageClasses](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#storageclass-v1-storage-k8s-io)
162162
来设置[动态提供存储](/blog/2016/10/dynamic-provisioning-and-storage-in-kubernetes)
163163

164164
下面是 hostPath PersistentVolume 的配置文件:
@@ -173,13 +173,12 @@ read-write by a single Node. It defines the [StorageClass name](/docs/concepts/s
173173
`manual` for the PersistentVolume, which will be used to bind
174174
PersistentVolumeClaim requests to this PersistentVolume.
175175
-->
176-
配置文件指定卷位于集群节点上的 `/mnt/data` 路径。
177-
配置还指定了卷的容量大小为 10 GB,
178-
访问模式为 `ReadWriteOnce`
176+
此配置文件指定卷位于集群节点上的 `/mnt/data` 路径。
177+
其配置还指定了卷的容量大小为 10 GB,访问模式为 `ReadWriteOnce`
179178
这意味着该卷可以被单个节点以读写方式安装。
180-
配置文件还在 PersistentVolume 中定义了
181-
[StorageClass 的名称](/zh-cn/docs/concepts/storage/persistent-volumes/#class)
182-
`manual`它将用于将 PersistentVolumeClaim 的请求绑定到此 PersistentVolume。
179+
此配置文件还在 PersistentVolume 中定义了
180+
[StorageClass 的名称](/zh-cn/docs/concepts/storage/persistent-volumes/#class)`manual`
181+
它将用于将 PersistentVolumeClaim 的请求绑定到此 PersistentVolume。
183182

184183
<!--
185184
Create the PersistentVolume:
@@ -203,11 +202,13 @@ kubectl get pv task-pv-volume
203202
The output shows that the PersistentVolume has a `STATUS` of `Available`. This
204203
means it has not yet been bound to a PersistentVolumeClaim.
205204
-->
206-
输出结果显示该 PersistentVolume 的`状态(STATUS)` `Available`
205+
输出结果显示该 PersistentVolume 的`状态(STATUS)``Available`
207206
这意味着它还没有被绑定给 PersistentVolumeClaim。
208207

209-
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
210-
task-pv-volume 10Gi RWO Retain Available manual 4s
208+
```
209+
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
210+
task-pv-volume 10Gi RWO Retain Available manual 4s
211+
```
211212

212213
<!--
213214
## Create a PersistentVolumeClaim
@@ -219,7 +220,7 @@ access for at least one Node.
219220
220221
Here is the configuration file for the PersistentVolumeClaim:
221222
-->
222-
## 创建 PersistentVolumeClaim
223+
## 创建 PersistentVolumeClaim {#create-a-pvc}
223224

224225
下一步是创建一个 PersistentVolumeClaim。
225226
Pod 使用 PersistentVolumeClaim 来请求物理存储。
@@ -294,11 +295,11 @@ The next step is to create a Pod that uses your PersistentVolumeClaim as a volum
294295
295296
Here is the configuration file for the Pod:
296297
-->
297-
## 创建 Pod
298+
## 创建 Pod {#create-a-pod}
298299

299-
下一步是创建一个 Pod, 该 Pod 使用你的 PersistentVolumeClaim 作为存储卷
300+
下一步是创建一个使用你的 PersistentVolumeClaim 作为存储卷的 Pod。
300301

301-
下面是 Pod 的 配置文件
302+
下面是此 Pod 的配置文件
302303

303304
{{< codenew file="pods/storage/pv-pod.yaml" >}}
304305

@@ -340,7 +341,7 @@ kubectl exec -it task-pv-pod -- /bin/bash
340341
In your shell, verify that nginx is serving the `index.html` file from the
341342
hostPath volume:
342343
-->
343-
在 Shell 中,验证 nginx 是否正在从 hostPath 卷提供 `index.html` 文件:
344+
在 Shell 中,验证 Nginx 是否正在从 hostPath 卷提供 `index.html` 文件:
344345

345346
<!--
346347
# Be sure to run these 3 commands inside the root shell that comes from
@@ -413,7 +414,7 @@ You can now close the shell to your Node.
413414
<!--
414415
## Mounting the same persistentVolume in two places
415416
-->
416-
## 在两个地方挂载相同的 persistentVolume
417+
## 在两个地方挂载相同的 persistentVolume {#mounting-the-same-pv-in-two-places}
417418

418419
{{< codenew file="pods/storage/pv-duplicate.yaml" >}}
419420

@@ -449,6 +450,7 @@ GID 不匹配或缺失将会导致无权访问错误。
449450
这样 GID 就能自动添加到使用 PersistentVolume 的任何 Pod 中。
450451

451452
使用 `pv.beta.kubernetes.io/gid` 注解的方法如下所示:
453+
452454
```yaml
453455
apiVersion: v1
454456
kind: PersistentVolume
@@ -468,8 +470,7 @@ each container.
468470
-->
469471
当 Pod 使用带有 GID 注解的 PersistentVolume 时,注解的 GID 会被应用于 Pod 中的所有容器,
470472
应用的方法与 Pod 的安全上下文中指定的 GID 相同。
471-
每个 GID,无论是来自 PersistentVolume 注解还是来自 Pod 规约,都会被应用于每个容器中
472-
运行的第一个进程。
473+
每个 GID,无论是来自 PersistentVolume 注解还是来自 Pod 规约,都会被应用于每个容器中运行的第一个进程。
473474
474475
<!--
475476
When a Pod consumes a PersistentVolume, the GIDs associated with the

0 commit comments

Comments
 (0)