@@ -65,7 +65,7 @@ that lets you store configuration for other objects to use. Unlike most
6565Kubernetes objects that have a `spec`, a ConfigMap has `data` and `binaryData`
6666fields. These fields accept key-value pairs as their values. Both the `data`
6767field and the `binaryData` are optional. The `data` field is designed to
68- contain UTF-8 byte sequences while the `binaryData` field is designed to
68+ contain UTF-8 strings while the `binaryData` field is designed to
6969contain binary data as base64-encoded strings.
7070
7171The name of a ConfigMap must be a valid
@@ -77,7 +77,7 @@ ConfigMap 是一个 API [对象](/zh/docs/concepts/overview/working-with-objects
7777让你可以存储其他对象所需要使用的配置。
7878和其他 Kubernetes 对象都有一个 ` spec ` 不同的是,ConfigMap 使用 ` data ` 和
7979` binaryData ` 字段。这些字段能够接收键-值对作为其取值。` data ` 和 ` binaryData `
80- 字段都是可选的。` data ` 字段设计用来保存 UTF-8 字节序列 ,而 ` binaryData `
80+ 字段都是可选的。` data ` 字段设计用来保存 UTF-8 字符串 ,而 ` binaryData `
8181则被设计用来保存二进制数据作为 base64 编码的字串。
8282
8383ConfigMap 的名字必须是一个合法的
@@ -289,6 +289,8 @@ To consume a ConfigMap in a volume in a Pod:
289289-->
290290# ## 在 Pod 中将 ConfigMap 当做文件使用
291291
292+ 要在一个 Pod 的存储卷中使用 ConfigMap :
293+
292294<!--
2932951. Create a ConfigMap or use an existing one. Multiple Pods can reference the
294296 same ConfigMap.
@@ -384,19 +386,11 @@ ConfigMap 既可以通过 watch 操作实现内容传播(默认形式),也
384386(分别对应 watch 操作的传播延迟、高速缓存的 TTL 时长或者 0)。
385387
386388<!--
387- ConfigMaps consumed as environment variables are not updated automatically and require a pod restart.
389+ ConfigMaps consumed as environment variables are not updated automatically and require a pod restart.
388390-->
389391以环境变量方式使用的 ConfigMap 数据不会被自动更新。
390392更新这些数据需要重新启动 Pod。
391393
392- {{< note >}}
393- <!--
394- A container using a ConfigMap as a [subPath](/docs/concepts/storage/volumes#using-subpath) volume mount will not receive ConfigMap updates.
395- -->
396- 将 ConfigMap 作为 [subPath](/docs/concepts/storage/volumes#using-subpath)
397- 卷挂载的容器无法收到 ConfigMap 更新。
398- {{< /note >}}
399-
400394<!--
401395A container using a ConfigMap as a [subPath](/docs/concepts/storage/volumes#using-subpath) volume mount will not receive ConfigMap updates.
402396-->
@@ -417,7 +411,7 @@ individual Secrets and ConfigMaps as immutable. For clusters that extensively us
417411(at least tens of thousands of unique ConfigMap to Pod mounts), preventing changes to their
418412data has the following advantages :
419413-->
420- Kubernetes 特性 _不可变更的 Secret 和 ConfigMap_ 提供了一种将各个
414+ Kubernetes 特性 _Immutable Secret 和 ConfigMaps_ 提供了一种将各个
421415Secret 和 ConfigMap 设置为不可变更的选项。对于大量使用 ConfigMap 的集群
422416(至少有数万个各不相同的 ConfigMap 给 Pod 挂载)而言,禁止更改
423417ConfigMap 的数据有以下好处:
@@ -460,7 +454,7 @@ to the deleted ConfigMap, it is recommended to recreate these pods.
460454-->
461455一旦某 ConfigMap 被标记为不可变更,则 _无法_ 逆转这一变化,,也无法更改
462456` data` 或 `binaryData` 字段的内容。你只能删除并重建 ConfigMap。
463- 因为现有的 Pod 会维护一个对已删除的 ConfigMap 的挂载点,建议重新创建这些 Pods。
457+ 因为现有的 Pod 会维护一个已被删除的 ConfigMap 的挂载点,建议重新创建这些 Pods。
464458
465459# # {{% heading "whatsnext" %}}
466460
@@ -473,4 +467,3 @@ to the deleted ConfigMap, it is recommended to recreate these pods.
473467* 阅读 [Secret](/zh/docs/concepts/configuration/secret/)。
474468* 阅读[配置 Pod 使用 ConfigMap](/zh/docs/tasks/configure-pod-container/configure-pod-configmap/)。
475469* 阅读 [Twelve-Factor 应用](https://12factor.net/zh_cn/)来了解将代码和配置分开的动机。
476-
0 commit comments