Kubernetes 101 : Using the pod's field values in YAML file



Some of the pod's fields could be used in a YAML file. 
As an example we can see below the "spec.nodeName", "status.podIP" and "metadata.name":


Other fields include the node IP address "status.hostIP" or the pod's namespace "metadata.namespace".

We could get access to these environment variables by getting inside the pod and checking them, for example for the IP address of the pod, we would use the below command :

Comments

Leave as a comment:

Archive