Home > Enterprise >  How to convert an environment variable declared inside a "yaml" file to something inside t
How to convert an environment variable declared inside a "yaml" file to something inside t

Time:01-16

I have an environment variable file that is declared like following inside a deployment.yaml file:

          env:
            - name: NATS_CLIENT_ID
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name

I am just wondering to know if I want to use an .env file instead of the deployment.yaml file, how can I declare the above port within the .env?

CodePudding user response:

Maybe you can create a configmap that contains your .env and use your configmap to inject the environment variables.

An example here: https://humanitec.com/blog/handling-environment-variables-with-kubernetes

  • Related