Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all environment variables for a Pod

I have a web app on OpenShift v3 (all-in-One), using the Wildfly Builder Image. In addition, I created a service named xyz, to point to an external host+IP. Something like this:

        "kind": "Service",
        "apiVersion": "v1",
        "metadata": { "name": "xyz" },
        "spec": {
            "ports": [
                {   "port": 61616,
                    "protocol": "TCP",
                    "targetPort": 61616
                }
            ],
            "selector": {}
        }

I also have an endpoint, pointing externally, but that is not relevant for this question.

When deployed, my program can access an environment variable named XYZ_PORT=tcp://172.30.192.186:61616

However, I cannot figure out how to see all the values of all such variables either via the web-console, or using the CLI. Using the web-console, I cannot see it being injected into the YAML.

I tried some of the oc env options, but none seem to list what I want.

like image 540
Darius X. Avatar asked Oct 19 '25 03:10

Darius X.


1 Answers

Let's say you are deploying kitchensink, then the below CLI should list all the environment variables:

oc env bc/kitchensink --list
like image 116
Anil Avatar answered Oct 22 '25 04:10

Anil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!