diff --git a/content/en/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md b/content/en/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md index 2fe432a7a4d4a..8be2a654ab9c4 100644 --- a/content/en/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md +++ b/content/en/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md @@ -199,13 +199,9 @@ The following information is available to containers through environment variables and `downwardAPI` volumes: * Information available via `fieldRef`: - * `spec.nodeName` - the node’s name - * `status.hostIP` - the node's IP * `metadata.name` - the pod’s name * `metadata.namespace` - the pod’s namespace - * `status.podIP` - the pod’s IP address - * `spec.serviceAccountName` - the pod’s service account name - * `metadata.uid` - the pod’s UID + * `metadata.uid` - the pod’s UID, available since v1.8.0-alpha.2 * `metadata.labels['']` - the value of the pod’s label `` (for example, `metadata.labels['mylabel']`); available in Kubernetes 1.9+ * `metadata.annotations['']` - the value of the pod’s annotation `` (for example, `metadata.annotations['myannotation']`); available in Kubernetes 1.9+ * Information available via `resourceFieldRef`: @@ -213,6 +209,8 @@ variables and `downwardAPI` volumes: * A Container’s CPU request * A Container’s memory limit * A Container’s memory request + * A Container’s ephemeral-storage limit, available since v1.8.0-beta.0 + * A Container’s ephemeral-storage request, available since v1.8.0-beta.0 In addition, the following information is available through `downwardAPI` volume `fieldRef`: @@ -220,6 +218,13 @@ In addition, the following information is available through * `metadata.labels` - all of the pod’s labels, formatted as `label-key="escaped-label-value"` with one label per line * `metadata.annotations` - all of the pod’s annotations, formatted as `annotation-key="escaped-annotation-value"` with one annotation per line +The following information is available through environment variables: + +* `status.podIP` - the pod’s IP address +* `spec.serviceAccountName` - the pod’s service account name, available since v1.4.0-alpha.3 +* `spec.nodeName` - the node’s name, available since v1.4.0-alpha.3 +* `status.hostIP` - the node's IP, available since v1.7.0-alpha.1 + {{< note >}} If CPU and memory limits are not specified for a Container, the Downward API defaults to the node allocatable value for CPU and memory. diff --git a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md index 8544e6221087c..ac3f4b3913c3f 100644 --- a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md +++ b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md @@ -169,22 +169,34 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh 下面这些信息可以通过环境变量和DownwardAPIVolumeFiles提供给容器: -* 节点名称 -* 节点IP -* Pod名称 -* Pod名字空间 -* Pod IP地址 -* Pod服务帐号名称 -* Pod的UID -* 容器的CPU约束 -* 容器的CPU请求值 -* 容器的内存约束 -* 容器的内存请求值 - -此外,以下信息可通过DownwardAPIVolumeFiles获得: - -* Pod的标签 -* Pod的注释 +能通过`fieldRef`获得的: + * `metadata.name` - Pod名称 + * `metadata.namespace` - Pod名字空间 + * `metadata.uid` - Pod的UID, 版本要求 v1.8.0-alpha.2 + * `metadata.labels['']` - 单个 pod 标签值 `` (例如, `metadata.labels['mylabel']`); 版本要求 Kubernetes 1.9+ + * `metadata.annotations['']` - 单个 pod 的标注值 `` (例如, `metadata.annotations['myannotation']`); 版本要求 Kubernetes 1.9+ + +能通过`resourceFieldRef`获得的: + * 容器的CPU约束值 + * 容器的CPU请求值 + * 容器的内存约束值 + * 容器的内存请求值 + * 容器的临时存储约束值, 版本要求 v1.8.0-beta.0 + * 容器的临时存储请求值, 版本要求 v1.8.0-beta.0 + +此外,以下信息可通过DownwardAPIVolumeFiles从`fieldRef`获得: + +* `metadata.labels` - all of the pod’s labels, formatted as `label-key="escaped-label-value"` with one label per line +* `metadata.annotations` - all of the pod’s annotations, formatted as `annotation-key="escaped-annotation-value"` with one annotation per line +* `metadata.labels` - 所有Pod的标签,以`label-key="escaped-label-value"`格式显示,每行显示一个label +* `metadata.annotations` - Pod的注释,以`annotation-key="escaped-annotation-value"`格式显示,每行显示一个标签 + +以下信息可通过环境变量从`fieldRef`获得: + +* `status.podIP` - 节点IP +* `spec.serviceAccountName` - Pod服务帐号名称, 版本要求 v1.4.0-alpha.3 +* `spec.nodeName` - 节点名称, 版本要求 v1.4.0-alpha.3 +* `status.hostIP` - 节点IP, 版本要求 v1.7.0-alpha.1 {{< note >}} 如果容器未指定CPU和memory limits,则Downward API默认为节点可分配值。