List of all environment variables for a Pod

拈花ヽ惹草 提交于 2019-12-11 06:37:01

问题


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.


回答1:


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

oc env bc/kitchensink --list


来源:https://stackoverflow.com/questions/40536743/list-of-all-environment-variables-for-a-pod

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!