We asked Wikipedia. An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs.

Kubernetes uses environment variables extensively; where configurations can be set globally.

Stuff you wanna know:

  1. When you create a Pod, you can set environment variables for the containers that run in the Pod.
  2. To set environment variables, include the env or envFrom field in the configuration file.
  3. The environment variables set using the env or envFrom field override any environment variables specified in the container image.
  4. When you create a Pod, you can set dependent environment variables for the containers that run in the Pod.
  5. To set dependent environment variables, you can use $(VAR_NAME) in the value of env in the configuration file.
  6. Environment variables may reference each other.
  7. Environment variables that you define in a Pod’s configuration can be used elsewhere in the configuration.
  8. You can use secrets as environment variables.
  9. If a container already consumes a Secret in an environment variable, a Secret update will not be seen by the container unless it is restarted.
  10. You can use environment variables to define arguments.
  11. You can use container fields as values for environment variables.
  12. You can define a container environment variable with data from a single or multiple  ConfigMaps.
  13. You can configure all key-value pairs in ConfigMap as container environment variables.
  14. You can use ConfigMap-defined environment variables in the command and args of a container using the $(VAR_NAME) Kubernetes substitution syntax.
  15. Want to see your environment variables? printenv is your friend!

More stuff: