content_image/787583.jpg content_image/787584.jpg content_image/787581.jpg content_image/787580.jpg
- name : MEMORY_LIMIT valueFrom : resourceFieldRef : container : random-generator resource : limits.memory 

The environment variable POD_IP  is set from the properties of this Pod and come into existence at Pod startup time. 

<img src='content_image/787583.jpg'>

The environment variable MEMORY_LIMIT  is set to the value of the memory resource limit of this container; the actual limit declaration is not shown here. 

<img src='content_image/787584.jpg'>

In this example we use fieldRef  to access Pod-level metadata. The keys shown in Table 13-1 are available for fieldRef.fieldPath  both as environment variables and downwardAPI  volumes. 

<img src='content_image/787581.jpg'>

Similarly to fieldRef , we can use resourceFieldRef  to access metadata specific to a container belonging to the Pod. This metadata is specific to a container which can be specified with resourceFieldRef.container . When used as environment variable then by default the current container is used. The possible keys for resourceFiel dRef.resource  are shown in Table 13-2. 

<img src='content_image/787580.jpg'>

