@@ -65,7 +65,7 @@ that lets you store configuration for other objects to use. Unlike most
65
65
Kubernetes objects that have a `spec`, a ConfigMap has `data` and `binaryData`
66
66
fields. These fields accept key-value pairs as their values. Both the `data`
67
67
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
69
69
contain binary data as base64-encoded strings.
70
70
71
71
The name of a ConfigMap must be a valid
@@ -77,7 +77,7 @@ ConfigMap 是一个 API [对象](/zh/docs/concepts/overview/working-with-objects
77
77
让你可以存储其他对象所需要使用的配置。
78
78
和其他 Kubernetes 对象都有一个 ` spec ` 不同的是,ConfigMap 使用 ` data ` 和
79
79
` binaryData ` 字段。这些字段能够接收键-值对作为其取值。` data ` 和 ` binaryData `
80
- 字段都是可选的。` data ` 字段设计用来保存 UTF-8 字节序列 ,而 ` binaryData `
80
+ 字段都是可选的。` data ` 字段设计用来保存 UTF-8 字符串 ,而 ` binaryData `
81
81
则被设计用来保存二进制数据作为 base64 编码的字串。
82
82
83
83
ConfigMap 的名字必须是一个合法的
@@ -289,6 +289,8 @@ To consume a ConfigMap in a volume in a Pod:
289
289
-->
290
290
# ## 在 Pod 中将 ConfigMap 当做文件使用
291
291
292
+ 要在一个 Pod 的存储卷中使用 ConfigMap :
293
+
292
294
<!--
293
295
1. Create a ConfigMap or use an existing one. Multiple Pods can reference the
294
296
same ConfigMap.
@@ -384,19 +386,11 @@ ConfigMap 既可以通过 watch 操作实现内容传播(默认形式),也
384
386
(分别对应 watch 操作的传播延迟、高速缓存的 TTL 时长或者 0)。
385
387
386
388
<!--
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.
388
390
-->
389
391
以环境变量方式使用的 ConfigMap 数据不会被自动更新。
390
392
更新这些数据需要重新启动 Pod。
391
393
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
-
400
394
<!--
401
395
A container using a ConfigMap as a [subPath](/docs/concepts/storage/volumes#using-subpath) volume mount will not receive ConfigMap updates.
402
396
-->
@@ -417,7 +411,7 @@ individual Secrets and ConfigMaps as immutable. For clusters that extensively us
417
411
(at least tens of thousands of unique ConfigMap to Pod mounts), preventing changes to their
418
412
data has the following advantages :
419
413
-->
420
- Kubernetes 特性 _不可变更的 Secret 和 ConfigMap_ 提供了一种将各个
414
+ Kubernetes 特性 _Immutable Secret 和 ConfigMaps_ 提供了一种将各个
421
415
Secret 和 ConfigMap 设置为不可变更的选项。对于大量使用 ConfigMap 的集群
422
416
(至少有数万个各不相同的 ConfigMap 给 Pod 挂载)而言,禁止更改
423
417
ConfigMap 的数据有以下好处:
@@ -460,7 +454,7 @@ to the deleted ConfigMap, it is recommended to recreate these pods.
460
454
-->
461
455
一旦某 ConfigMap 被标记为不可变更,则 _无法_ 逆转这一变化,,也无法更改
462
456
` data` 或 `binaryData` 字段的内容。你只能删除并重建 ConfigMap。
463
- 因为现有的 Pod 会维护一个对已删除的 ConfigMap 的挂载点,建议重新创建这些 Pods。
457
+ 因为现有的 Pod 会维护一个已被删除的 ConfigMap 的挂载点,建议重新创建这些 Pods。
464
458
465
459
# # {{% heading "whatsnext" %}}
466
460
@@ -473,4 +467,3 @@ to the deleted ConfigMap, it is recommended to recreate these pods.
473
467
* 阅读 [Secret](/zh/docs/concepts/configuration/secret/)。
474
468
* 阅读[配置 Pod 使用 ConfigMap](/zh/docs/tasks/configure-pod-container/configure-pod-configmap/)。
475
469
* 阅读 [Twelve-Factor 应用](https://12factor.net/zh_cn/)来了解将代码和配置分开的动机。
476
-
0 commit comments