Skip to content

Commit 5c090ea

Browse files
authored
Merge pull request #22257 from pistoolster/patch-1
Update configure-pod-configmap.md
2 parents b647c7b + 64896ca commit 5c090ea

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

content/zh/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ data:
331331
```
332332
333333
<!-- #### Define the key to use when creating a ConfigMap from a file -->
334-
#### 定义从文件创建 ConfigMap 时要使用的密钥
334+
#### 定义从文件创建 ConfigMap 时要使用的键
335335
336336
<!-- You can define a key other than the file name to use in the `data` section of your ConfigMap when using the `--from-file` argument: -->
337337
您可以在使用 `--from-file` 参数时,在 ConfigMap 的 `data` 部分中定义除文件名以外的其他键:
@@ -341,7 +341,7 @@ kubectl create configmap game-config-3 --from-file=<my-key-name>=<path-to-file>
341341
```
342342

343343
<!-- where `<my-key-name>` is the key you want to use in the ConfigMap and `<path-to-file>` is the location of the data source file you want the key to represent. -->
344-
`<my-key-name>` 是您要在 ConfigMap 中使用的密钥, `<path-to-file>` 是您想要键表示数据源文件的位置。
344+
`<my-key-name>` 是您要在 ConfigMap 中使用的键名, `<path-to-file>` 是您想要键表示数据源文件的位置。
345345

346346
<!-- For example: -->
347347
例如:
@@ -664,7 +664,7 @@ very charm
664664
## 将 ConfigMap 数据添加到一个容器中
665665

666666
<!-- As explained in [Create ConfigMaps from files](#create-configmaps-from-files), when you create a ConfigMap using ``--from-file``, the filename becomes a key stored in the `data` section of the ConfigMap. The file contents become the key's value. -->
667-
如[根据文件创建ConfigMap](#create-configmaps-from-files)中所述,当您使用 ``--from-file`` 创建 ConfigMap 时,文件名成为存储在 ConfigMap 的 `data` 部分中的密钥,文件内容成为密钥的值
667+
如[根据文件创建ConfigMap](#create-configmaps-from-files)中所述,当您使用 ``--from-file`` 创建 ConfigMap 时,文件名成为存储在 ConfigMap 的 `data` 部分中的键,文件内容成为键对应的值
668668

669669
<!-- The examples in this section refer to a ConfigMap named special-config, shown below. -->
670670
本节中的示例引用了一个名为 special-config 的 ConfigMap,如下所示:
@@ -679,7 +679,7 @@ kubectl create -f https://kubernetes.io/examples/configmap/configmap-multikeys.y
679679
```
680680

681681
<!-- ### Populate a Volume with data stored in a ConfigMap -->
682-
### 使用存储在 ConfigMap 中的数据填充容器
682+
### 使用存储在 ConfigMap 中的数据填充数据卷
683683

684684
<!-- Add the ConfigMap name under the `volumes` section of the Pod specification.
685685
This adds the ConfigMap data to the directory specified as `volumeMounts.mountPath` (in this case, `/etc/config`).
@@ -711,12 +711,12 @@ SPECIAL_TYPE
711711
{{< /caution >}}
712712

713713
<!-- ### Add ConfigMap data to a specific path in the Volume -->
714-
### 将 ConfigMap 数据添加到容器中的特定路径
714+
### 将 ConfigMap 数据添加到数据卷中的特定路径
715715

716716
<!-- Use the `path` field to specify the desired file path for specific ConfigMap items.
717717
In this case, the `SPECIAL_LEVEL` item will be mounted in the `config-volume` volume at `/etc/config/keys`. -->
718718
使用 `path` 字段为特定的 ConfigMap 项目指定所需的文件路径。
719-
在这种情况下, `SPECIAL_LEVEL` 将安装在 `/etc/config/keys` 目录下的 `config-volume` 容器中
719+
在这种情况下, `SPECIAL_LEVEL` 将挂载在 `/etc/config/keys` 目录下的 `config-volume` 数据卷中
720720

721721
{{< codenew file="pods/pod-configmap-volume-specific-key.yaml" >}}
722722

@@ -736,25 +736,25 @@ very
736736

737737
{{< caution >}}
738738
<!-- Like before, all previous files in the `/etc/config/` directory will be deleted. -->
739-
和以前一样`/etc/config/` 目录中的所有先前文件都将被删除
739+
如之前所说`/etc/config/` 目录中所有先前的文件都将被删除
740740
{{< /caution >}}
741741

742742
<!-- ### Project keys to specific paths and file permissions -->
743-
### 项目密钥以指定路径和文件权限
743+
### 映射键以指定路径和文件权限
744744

745745
<!-- You can project keys to specific paths and specific permissions on a per-file
746746
basis. The [Secrets](/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod) user guide explains the syntax. -->
747-
您可以将密钥映射到每个文件的特定路径和特定权限。[Secrets](/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod) 用户指南说明了语法。
747+
您可以通过映射键来指定每个文件的特定路径和特定权限。[Secrets](/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod) 用户指南说明了语法。
748748

749749
<!-- ### Mounted ConfigMaps are updated automatically -->
750750
### 挂载的 ConfigMap 将自动更新
751751

752752
<!-- When a ConfigMap already being consumed in a volume is updated, projected keys are eventually updated as well. Kubelet is checking whether the mounted ConfigMap is fresh on every periodic sync. However, it is using its local ttl-based cache for getting the current value of the ConfigMap. As a result, the total delay from the moment when the ConfigMap is updated to the moment when new keys are projected to the pod can be as long as kubelet sync period + ttl of ConfigMaps cache in kubelet. -->
753-
更新已经在容器中使用的 ConfigMap 时,最终也会更新映射键。Kubelet 实时检查是否在每个定期同步中都更新已安装的 ConfigMap。它使用其基于本地 ttl 的缓存来获取 ConfigMap 的当前值。结果,从更新 ConfigMap 到将新密钥映射到 Pod 的总延迟可以与 ConfigMap 在 kubelet 中缓存的 kubelet 同步周期 ttl 一样长。
753+
更新已经在数据卷中使用的 ConfigMap 时,最终也会更新映射键。Kubelet 在每次定期同步时都会检查已挂载的 ConfigMap 是否过期。它使用其基于本地 ttl 的缓存来获取 ConfigMap 的当前值。因此,更新 ConfigMap 到将新键映射到 Pod 的总延迟可能与 kubelet 同步周期 + ConfigMap 在 kubelet 中缓存的 ttl 一样长。
754754

755755
{{< note >}}
756756
<!-- A container using a ConfigMap as a [subPath](/docs/concepts/storage/volumes/#using-subpath) volume will not receive ConfigMap updates. -->
757-
使用 ConfigMap 作为子路径[subPath](/docs/concepts/storage/volumes/#using-subpath)的容器将不会收到 ConfigMap 更新。
757+
使用 ConfigMap 作为[子路径](/docs/concepts/storage/volumes/#using-subpath)的数据卷将不会收到 ConfigMap 更新。
758758
{{< /note >}}
759759

760760

@@ -769,11 +769,11 @@ ConfigMap API 资源将配置数据存储为键值对。数据可以在 Pod 中
769769

770770
{{< note >}}
771771
<!-- ConfigMaps should reference properties files, not replace them. Think of the ConfigMap as representing something similar to the Linux `/etc` directory and its contents. For example, if you create a [Kubernetes Volume](/docs/concepts/storage/volumes/) from a ConfigMap, each data item in the ConfigMap is represented by an individual file in the volume. -->
772-
ConfigMap 应该引用属性文件,而不是替换它们。可以将 ConfigMap 表示为类似于 Linux `/etc` 目录及其内容的东西。例如,如果您从 ConfigMap 创建[Kubernetes Volume](/docs/concepts/storage/volumes/),则 ConfigMap 中的每个数据项都由该容器中的单个文件表示
772+
ConfigMap 应该引用属性文件,而不是替换它们。可以将 ConfigMap 理解为类似于 Linux `/etc` 目录及其内容的东西。例如,如果您从 ConfigMap 创建[Kubernetes Volume](/docs/concepts/storage/volumes/),则 ConfigMap 中的每个数据项都由该数据卷中的单个文件表示
773773
{{< /note >}}
774774

775775
<!-- The ConfigMap's `data` field contains the configuration data. As shown in the example below, this can be simple -- like individual properties defined using `--from-literal` -- or complex -- like configuration files or JSON blobs defined using `--from-file`. -->
776-
ConfigMap 的 `data` 字段包含配置数据。如下例所示,它可以很简单 -- 就像使用 `--from-literal` -- 定义的单个属性一样,也可以很复杂 -- 例如使用 `--from-file` 定义的配置文件或 JSON blob
776+
ConfigMap 的 `data` 字段包含配置数据。如下例所示,它可以简单(如用 `--from-literal` 的单个属性定义)或复杂(如用 `--from-file` 的配置文件或 JSON blob定义)
777777
778778
```yaml
779779
apiVersion: v1
@@ -797,7 +797,7 @@ data:
797797
### 限制规定
798798
799799
<!-- - You must create a ConfigMap before referencing it in a Pod specification (unless you mark the ConfigMap as "optional"). If you reference a ConfigMap that doesn't exist, the Pod won't start. Likewise, references to keys that don't exist in the ConfigMap will prevent the pod from starting. -->
800-
- 在 Pod 规范中引用它之前,必须先创建一个 ConfigMap(除非将 ConfigMap 标记为"可选")。如果引用的 ConfigMap 不存在,则 Pod 将不会启动。同样, ConfigMap 中不存在的键的引用将阻止容器启动
800+
- 在 Pod 规范中引用之前,必须先创建一个 ConfigMap(除非将 ConfigMap 标记为"可选")。如果引用的 ConfigMap 不存在,则 Pod 将不会启动。同样,引用 ConfigMap 中不存在的键也会阻止 Pod 启动
801801

802802
<!-- - If you use `envFrom` to define environment variables from ConfigMaps, keys that are considered invalid will be skipped. The pod will be allowed to start, but the invalid names will be recorded in the event log (`InvalidVariableNames`). The log message lists each skipped key. For example: -->
803803
- 如果您使用 `envFrom` 从 ConfigMap 中定义环境变量,那么将忽略被认为无效的键。可以启动 Pod,但无效名称将记录在事件日志中(InvalidVariableNames)。日志消息列出了每个跳过的键。例如:
@@ -814,15 +814,14 @@ data:
814814
```
815815

816816
<!-- - ConfigMaps reside in a specific [namespace](/docs/concepts/overview/working-with-objects/namespaces/). A ConfigMap can only be referenced by pods residing in the same namespace. -->
817-
- ConfigMaps reside in a specific [命令空间](/docs/concepts/overview/working-with-objects/namespaces/). A ConfigMap can only be referenced by pods residing in the same namespace.
818-
ConfigMap 驻留在特定的[命令空间](/docs/concepts/overview/working-with-objects/namespaces/)中。ConfigMap 只能由位于相同命令空间中的 Pod 引用。
817+
- ConfigMap 位于特定的[命名空间](/docs/concepts/overview/working-with-objects/namespaces/)中. 每个 ConfigMap 只能被同一命名空间中的 Pod 引用.
819818

820819
<!-- - Kubelet doesn't support the use of ConfigMaps for pods not found on the API server. This includes pods created via the Kubelet's `--manifest-url` flag, `--config` flag, or the Kubelet REST API. -->
821-
- Kubelet 不支持将 ConfigMap 用于未在 API 服务器上找到的 Pod。这包括通过 Kubelet 的 `--manifest-url` 参数,`--config` 参数或者 Kubelet REST API 创建的容器。
820+
- Kubelet 不支持将 ConfigMap 用于未在 API 服务器上找到的 Pod。包括通过 Kubelet 的 `--manifest-url` 参数,`--config` 参数或者 Kubelet REST API 创建的容器。
822821

823822
{{< note >}}
824823
<!-- These are not commonly-used ways to create pods. -->
825-
这些不是创建 pods 的常用方法。
824+
以上并不是创建 Pod 的常用方法。
826825
{{< /note >}}
827826

828827

0 commit comments

Comments
 (0)