Skip to content

Environment variables

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

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

Clone this wiki locally