Skip to content

Environment variables

Stéphane Brunner edited this page Jun 27, 2024 · 2 revisions

In the containers, you can define the env and configMapNameOverride dictionaries with, for the env:

The key represents the environment variable name, and the value is a dictionary with a type key.

On the container, you can specify the environment variable like that:

ENV_NAME:
  value: The value

If you want to get it from the own secret:

secrets:
  content:
    secret-key:
      value: secret-value

...

ENV_NAME:
  type: secret
  name: self
  key: secret-key

Same for config map:

configMaps:
  content:
    config-map-key:
      value: config-map-value

...

ENV_NAME:
  type: configMap
  name: self
  key: config-map-key

And for metadata config map

metadata:
  enabled: true

...

ENV_NAME:
  type: configMap
  name: self-metadata
  key: key

To be able to use variable substitution, you should set the order to 1 because of the order in the generated file is important, e.g.:

USED_ENV_NAME:
  value: The value
ENV_NAME:
  value: prefix-$(USED_ENV_NAME)-postfix
  order: 1

Currently, we put at first the order <= 0 and at last the order > 0, default is 0 (first).

If the type is none the environment variable will be ignored, example:

env:
  VAR:
    type: none

Clone this wiki locally