ENV variables in Kubernetes (Config Maps)

Ishan Liyanage
2 min readDec 20, 2020

Lets discuss how to set an environment variables in Kubernetes.

In a POD definition file, we can use ENV property. ENV is an array. So every item under ENV property start with a dash (-) indicating an item in the array. Each item has name and value property. The name is the name of the environment variable and the value is its value as name suggests.

env:
- name: VARIABLE1
value: TEST

This is direct way of specifying the environment variables using the plain key-value pair.

Ishan Liyanage

Passionate Technical Lead, Senior Software Developer and free and open source software advocate. Based in Singapore.