document pod downwardAPI fieldRef values (#8217)

pull/8312/merge
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
The following information is available to Containers through environment
variables and DownwardAPIVolumeFiles:
The following information is available to containers through environment
variables and `downwardAPI` volumes:
* The Nodes name
* The Node's IP
* The Pods name
* The Pods namespace
* The Pods IP address
* The Pods service account name
* The Pods UID
* A Containers CPU limit
* A Containers CPU request
* A Containers memory limit
* A Containers memory request
* Information available via `fieldRef`:
* `spec.nodeName` - the nodes name
* `status.hostIP` - the node's IP
* `metadata.name` - the pods name
* `metadata.namespace` - the pods namespace
* `status.podIP` - the pods IP address
* `spec.serviceAccountName` - the pods service account name
* `metadata.uid` - the pods UID
* `metadata.labels['<KEY>']` - the value of the pods label `<KEY>` (for example, `metadata.labels['mylabel']`); available in Kubernetes 1.9+
* `metadata.annotations['<KEY>']` - the value of the pods annotation `<KEY>` (for example, `metadata.annotations['myannotation']`); available in Kubernetes 1.9+
* 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
DownwardAPIVolumeFiles.
`downwardAPI` volume `fieldRef`:
* The Pod's labels
* The Pod's annotations
* `metadata.labels` - all of the pods labels, formatted as `label-key="escaped-label-value"` with one label per line
* `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
Downward API defaults to the node allocatable value for CPU and memory.