Skip to content

Commit ef2f738

Browse files
authored
Merge pull request #39805 from windsonsea/pvccon
[zh] sync configure-persistent-volume-storage.md
2 parents 3ea93fa + 5038eba commit ef2f738

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
title: 配置 Pod 以使用 PersistentVolume 作为存储
33
content_type: task
4-
weight: 60
4+
weight: 90
55
---
6-
76
<!--
87
title: Configure a Pod to Use a PersistentVolume for Storage
98
content_type: task
10-
weight: 60
9+
weight: 90
1110
-->
1211

1312
<!-- overview -->
@@ -19,11 +18,11 @@ for storage.
1918
Here is a summary of the process:
2019
2120
1. You, as cluster administrator, create a PersistentVolume backed by physical
22-
storage. You do not associate the volume with any Pod.
21+
storage. You do not associate the volume with any Pod.
2322
2423
1. You, now taking the role of a developer / cluster user, create a
25-
PersistentVolumeClaim that is automatically bound to a suitable
26-
PersistentVolume.
24+
PersistentVolumeClaim that is automatically bound to a suitable
25+
PersistentVolume.
2726
2827
1. You create a Pod that uses the above PersistentVolumeClaim for storage.
2928
-->
@@ -43,15 +42,14 @@ PersistentVolume.
4342

4443
<!--
4544
* You need to have a Kubernetes cluster that has only one Node, and the
46-
{{< glossary_tooltip text="kubectl" term_id="kubectl" >}}
47-
command-line tool must be configured to communicate with your cluster. If you
48-
do not already have a single-node cluster, you can create one by using
49-
[Minikube](https://minikube.sigs.k8s.io/docs/).
45+
{{< glossary_tooltip text="kubectl" term_id="kubectl" >}}
46+
command-line tool must be configured to communicate with your cluster. If you
47+
do not already have a single-node cluster, you can create one by using
48+
[Minikube](https://minikube.sigs.k8s.io/docs/).
5049
5150
* Familiarize yourself with the material in
52-
[Persistent Volumes](/docs/concepts/storage/persistent-volumes/).
51+
[Persistent Volumes](/docs/concepts/storage/persistent-volumes/).
5352
-->
54-
5553
* 你需要一个包含单个节点的 Kubernetes 集群,并且必须配置
5654
{{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 命令行工具以便与集群交互。
5755
如果还没有单节点集群,可以使用
@@ -101,11 +99,11 @@ In the `/mnt/data` directory, create an `index.html` file:
10199
sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html"
102100
```
103101

102+
{{< note >}}
104103
<!--
105104
If your Node uses a tool for superuser access other than `sudo`, you can
106105
usually make this work if you replace `sudo` with the name of the other tool.
107106
-->
108-
{{< note >}}
109107
如果你的节点使用某工具而不是 `sudo` 来完成超级用户访问,你可以将上述命令中的 `sudo` 替换为该工具的名称。
110108
{{< /note >}}
111109

@@ -374,7 +372,7 @@ use storage from a PersistentVolumeClaim.
374372
<!--
375373
## Clean up
376374
377-
Delete the Pod, the PersistentVolumeClaim and the PersistentVolume:
375+
Delete the Pod, the PersistentVolumeClaim and the PersistentVolume:
378376
-->
379377
## 清理 {#clean-up}
380378

@@ -395,11 +393,11 @@ In the shell on your Node, remove the file and directory that you created:
395393
如果你还没有连接到集群中节点的 Shell,可以按之前所做操作,打开一个新的 Shell。
396394

397395
在节点的 Shell 上,删除你所创建的目录和文件:
396+
398397
<!--
399398
# This assumes that your Node uses "sudo" to run commands
400399
# as the superuser
401400
-->
402-
403401
```shell
404402
# 这里假定你使用 "sudo" 来以超级用户的角色执行命令
405403
sudo rm /mnt/data/index.html
@@ -426,8 +424,8 @@ You can perform 2 volume mounts on your nginx container:
426424
-->
427425
你可以在 nginx 容器上执行两个卷挂载:
428426

429-
`/usr/share/nginx/html` 用于静态网站
430-
`/etc/nginx/nginx.conf` 作为默认配置
427+
- `/usr/share/nginx/html` 用于静态网站
428+
- `/etc/nginx/nginx.conf` 作为默认配置
431429

432430
<!-- discussion -->
433431

@@ -472,11 +470,11 @@ each container.
472470
应用的方法与 Pod 的安全上下文中指定的 GID 相同。
473471
每个 GID,无论是来自 PersistentVolume 注解还是来自 Pod 规约,都会被应用于每个容器中运行的第一个进程。
474472
473+
{{< note >}}
475474
<!--
476475
When a Pod consumes a PersistentVolume, the GIDs associated with the
477476
PersistentVolume are not present on the Pod resource itself.
478477
-->
479-
{{< note >}}
480478
当 Pod 使用 PersistentVolume 时,与 PersistentVolume 关联的 GID 不会在 Pod
481479
资源本身的对象上出现。
482480
{{< /note >}}
@@ -493,7 +491,7 @@ PersistentVolume are not present on the Pod resource itself.
493491
<!--
494492
### Reference
495493
-->
496-
### 参考
494+
### 参考 {#reference}
497495
498496
* [PersistentVolume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#persistentvolume-v1-core)
499497
* [PersistentVolumeSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#persistentvolumespec-v1-core)

0 commit comments

Comments
 (0)