Kubernetes 101 : Field values of a container in a deployment YAML file

We could use use the container's fields as environment variables, like for example in the below deployment's YAML configuration file:

Now the "debian" container has access to the below container's fields - cpu, memory requests and limits - in the form of the below environment variables:
  • request_cpu
  • request_memory
  • limit_cpu
  • limit_memory
We could, for example, tell our container to print the "request_cpu" environment variable by adding the below in the container's section of our YAML file:



Leave as a comment: