Skip to content

Commit 15355e0

Browse files
authored
Merge pull request #37804 from gaogao101/work27
[zh-cn] Updated volumes.md
2 parents 396f5fe + db46517 commit 15355e0

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

content/zh-cn/docs/concepts/storage/volumes.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -577,18 +577,33 @@ Some uses for an `emptyDir` are:
577577
* 在 Web 服务器容器服务数据时,保存内容管理器容器获取的文件。
578578

579579
<!--
580-
Depending on your environment, `emptyDir` volumes are stored on whatever medium that backs the
581-
node such as disk or SSD, or network storage. However, if you set the `emptyDir.medium` field
582-
to `"Memory"`, Kubernetes mounts a tmpfs (RAM-backed filesystem) for you instead.
583-
While tmpfs is very fast, be aware that unlike disks, tmpfs is cleared on
584-
node reboot and any files you write count against your container's
585-
memory limit.
586-
-->
587-
取决于你的环境,`emptyDir` 卷存储在该节点所使用的介质上;这里的介质可以是磁盘或 SSD
588-
或网络存储。但是,你可以将 `emptyDir.medium` 字段设置为 `"Memory"`,以告诉 Kubernetes
589-
为你挂载 tmpfs(基于 RAM 的文件系统)。
590-
虽然 tmpfs 速度非常快,但是要注意它与磁盘不同。
591-
tmpfs 在节点重启时会被清除,并且你所写入的所有文件都会计入容器的内存消耗,受容器内存限制约束。
580+
The `emptyDir.medium` field controls where `emptyDir` volumes are stored. By
581+
default `emptyDir` volumes are stored on whatever medium that backs the node
582+
such as disk, SSD, or network storage, depending on your environment. If you set
583+
the `emptyDir.medium` field to `"Memory"`, Kubernetes mounts a tmpfs (RAM-backed
584+
filesystem) for you instead. While tmpfs is very fast, be aware that unlike
585+
disks, tmpfs is cleared on node reboot and any files you write count against
586+
your container's memory limit.
587+
-->
588+
`emptyDir.medium` 字段用来控制 `emptyDir` 卷的存储位置。
589+
默认情况下,`emptyDir` 卷存储在该节点所使用的介质上;
590+
此处的介质可以是磁盘、SSD 或网络存储,这取决于你的环境。
591+
你可以将 `emptyDir.medium` 字段设置为 `"Memory"`,
592+
以告诉 Kubernetes 为你挂载 tmpfs(基于 RAM 的文件系统)。
593+
虽然 tmpfs 速度非常快,但是要注意它与磁盘不同:tmpfs 在节点重启时会被清除,
594+
并且你所写入的所有文件都会计入容器的内存消耗,受容器内存限制约束。
595+
596+
<!--
597+
A size limit can be specified for the default medium, which limits the capacity
598+
of the `emptyDir` volume. The storage is allocated from [node ephemeral
599+
storage](docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage).
600+
If that is filled up from another source (for example, log files or image
601+
overlays), the `emptyDir` may run out of capacity before this limit.
602+
-->
603+
你可以通过为默认介质指定大小限制,来限制 `emptyDir` 卷的存储容量。
604+
此存储是从[节点临时存储](/zh-cn/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage)中分配的。
605+
如果来自其他来源(如日志文件或镜像分层数据)的数据占满了存储,`emptyDir`
606+
可能会在达到此限制之前发生存储容量不足的问题。
592607

593608
{{< note >}}
594609
<!--
@@ -620,7 +635,8 @@ spec:
620635
name: cache-volume
621636
volumes:
622637
- name: cache-volume
623-
emptyDir: {}
638+
emptyDir:
639+
sizeLimit: 500Mi
624640
```
625641

626642
<!--
@@ -886,7 +902,7 @@ spec:
886902
```
887903

888904
<!--
889-
### glusterfs (deprecated)
905+
### glusterfs (deprecated) {#glusterfs}
890906
-->
891907
### glusterfs(已弃用) {#glusterfs}
892908

@@ -897,7 +913,7 @@ A `glusterfs` volume allows a [Glusterfs](https://www.gluster.org) (an open
897913
source networked filesystem) volume to be mounted into your Pod. Unlike
898914
`emptyDir`, which is erased when a Pod is removed, the contents of a
899915
`glusterfs` volume are preserved and the volume is merely unmounted. This
900-
means that a glusterfs volume can be pre-populated with data, and that data can
916+
means that a `glusterfs` volume can be pre-populated with data, and that data can
901917
be shared between pods. GlusterFS can be mounted by multiple writers
902918
simultaneously.
903919
-->
@@ -1270,7 +1286,7 @@ spec:
12701286
nfs:
12711287
server: my-nfs-server.example.com
12721288
path: /my-nfs-volume
1273-
readonly: true
1289+
readOnly: true
12741290
```
12751291

12761292
{{< note >}}
@@ -2093,7 +2109,7 @@ The following in-tree plugins support persistent storage on Windows nodes:
20932109
* [`vsphereVolume`](#vspherevolume)
20942110

20952111
<!--
2096-
### flexVolume (deprecated)
2112+
### flexVolume (deprecated) {#flexvolume}
20972113
-->
20982114
### flexVolume(已弃用) {#flexvolume}
20992115

0 commit comments

Comments
 (0)