@@ -577,18 +577,33 @@ Some uses for an `emptyDir` are:
577
577
* 在 Web 服务器容器服务数据时,保存内容管理器容器获取的文件。
578
578
579
579
<!--
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
+ 可能会在达到此限制之前发生存储容量不足的问题。
592
607
593
608
{{< note >}}
594
609
<!--
@@ -620,7 +635,8 @@ spec:
620
635
name: cache-volume
621
636
volumes:
622
637
- name: cache-volume
623
- emptyDir: {}
638
+ emptyDir:
639
+ sizeLimit: 500Mi
624
640
` ` `
625
641
626
642
<!--
@@ -886,7 +902,7 @@ spec:
886
902
` ` `
887
903
888
904
<!--
889
- # ## glusterfs (deprecated)
905
+ # ## glusterfs (deprecated) {#glusterfs}
890
906
-->
891
907
# ## glusterfs(已弃用) {#glusterfs}
892
908
@@ -897,7 +913,7 @@ A `glusterfs` volume allows a [Glusterfs](https://www.gluster.org) (an open
897
913
source networked filesystem) volume to be mounted into your Pod. Unlike
898
914
` emptyDir` , which is erased when a Pod is removed, the contents of a
899
915
` 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
901
917
be shared between pods. GlusterFS can be mounted by multiple writers
902
918
simultaneously.
903
919
-->
@@ -1270,7 +1286,7 @@ spec:
1270
1286
nfs:
1271
1287
server: my-nfs-server.example.com
1272
1288
path: /my-nfs-volume
1273
- readonly : true
1289
+ readOnly : true
1274
1290
` ` `
1275
1291
1276
1292
{{< note >}}
@@ -2093,7 +2109,7 @@ The following in-tree plugins support persistent storage on Windows nodes:
2093
2109
* [`vsphereVolume`](#vspherevolume)
2094
2110
2095
2111
<!--
2096
- # ## flexVolume (deprecated)
2112
+ # ## flexVolume (deprecated) {#flexvolume}
2097
2113
-->
2098
2114
# ## flexVolume(已弃用) {#flexvolume}
2099
2115
0 commit comments