Skip to content

Commit 5f3c976

Browse files
authored
Merge pull request #32707 from zaunist/docs/concepts_configmap.md
[zh]: Resync concepts/configmap.md
2 parents cb3050c + 8ab6120 commit 5f3c976

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

content/en/docs/concepts/configuration/configmap.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ If the data you want to store are confidential, use a
1515
or use additional (third party) tools to keep your data private.
1616
{{< /caution >}}
1717

18-
1918
<!-- body -->
2019
## Motivation
2120

@@ -282,5 +281,3 @@ to the deleted ConfigMap, it is recommended to recreate these pods.
282281
* Read [Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/).
283282
* Read [The Twelve-Factor App](https://12factor.net/) to understand the motivation for
284283
separating code from configuration.
285-
286-

content/zh/docs/concepts/configuration/configmap.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ that lets you store configuration for other objects to use. Unlike most
6565
Kubernetes objects that have a `spec`, a ConfigMap has `data` and `binaryData`
6666
fields. These fields accept key-value pairs as their values. Both the `data`
6767
field 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
6969
contain binary data as base64-encoded strings.
7070
7171
The 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

8383
ConfigMap 的名字必须是一个合法的
@@ -289,6 +289,8 @@ To consume a ConfigMap in a volume in a Pod:
289289
-->
290290
### 在 Pod 中将 ConfigMap 当做文件使用
291291

292+
要在一个 Pod 的存储卷中使用 ConfigMap:
293+
292294
<!--
293295
1. 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
<!--
401395
A 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
418412
data has the following advantages:
419413
-->
420-
Kubernetes 特性 _不可变更的 Secret 和 ConfigMap_ 提供了一种将各个
414+
Kubernetes 特性 _Immutable Secret 和 ConfigMaps_ 提供了一种将各个
421415
Secret 和 ConfigMap 设置为不可变更的选项。对于大量使用 ConfigMap 的集群
422416
(至少有数万个各不相同的 ConfigMap 给 Pod 挂载)而言,禁止更改
423417
ConfigMap 的数据有以下好处:
@@ -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

Comments
 (0)