document pod downwardAPI fieldRef values (#8217)

This commit is contained in:
Jordan Liggitt 2018-05-04 18:11:51 -04:00 committed by k8s-ci-robot
parent 3ceca3fb05
commit 6c816ff9ff
1 changed files with 20 additions and 16 deletions

View File

@ -190,26 +190,30 @@ You can use similar commands to view the `cpu_request`, `mem_limit` and
## Capabilities of the Downward API ## Capabilities of the Downward API
The following information is available to Containers through environment The following information is available to containers through environment
variables and DownwardAPIVolumeFiles: variables and `downwardAPI` volumes:
* The Nodes name * Information available via `fieldRef`:
* The Node's IP * `spec.nodeName` - the nodes name
* The Pods name * `status.hostIP` - the node's IP
* The Pods namespace * `metadata.name` - the pods name
* The Pods IP address * `metadata.namespace` - the pods namespace
* The Pods service account name * `status.podIP` - the pods IP address
* The Pods UID * `spec.serviceAccountName` - the pods service account name
* A Containers CPU limit * `metadata.uid` - the pods UID
* A Containers CPU request * `metadata.labels['<KEY>']` - the value of the pods label `<KEY>` (for example, `metadata.labels['mylabel']`); available in Kubernetes 1.9+
* A Containers memory limit * `metadata.annotations['<KEY>']` - the value of the pods annotation `<KEY>` (for example, `metadata.annotations['myannotation']`); available in Kubernetes 1.9+
* A Containers memory request * Information available via `resourceFieldRef`:
* A Containers CPU limit
* A Containers CPU request
* A Containers memory limit
* A Containers memory request
In addition, the following information is available through In addition, the following information is available through
DownwardAPIVolumeFiles. `downwardAPI` volume `fieldRef`:
* The Pod's labels * `metadata.labels` - all of the pods labels, formatted as `label-key="escaped-label-value"` with one label per line
* The Pod's annotations * `metadata.annotations` - all of the pods annotations, formatted as `annotation-key="escaped-annotation-value"` with one annotation per line
**Note:** If CPU and memory limits are not specified for a Container, the **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. Downward API defaults to the node allocatable value for CPU and memory.