Openshift or Kubernate environment variables from file

4/22/2020

I want to know if there is anyway to define the kubernate or openshift template to load environment variables from a file in one of the volumes.

What i'm trying to achieve is to:

  • generate a value on a initContainer
  • write value on a file
  • load value as an environment variable when starting the main container

If anyone knows an alternative to allow the main container to read a environment variable generated from the initContainer it will solve my problem too

Thank you

-- Ignacio Molina Cuquerella
kubernetes
openshift

0 Answers