OpenShift environment variable from secret

4k views Asked by At

I have some environment variables in OpenShift that reference a secret. I can add these variables in the deployment config by editing the yaml deployment file. However, is there any way to set environment variables by referencing a secret using the oc env command?

Thanks :)

1

There are 1 answers

3
Graham Dumpleton On

Run:

oc set env --help

One of the examples is:

oc set env --from=secret/mysecret dc/myapp

Note that oc env is deprecated and you should use oc set env.