OpenShift Environment Variables: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:


Some environment variables are automatically exported:
Some environment variables are automatically exported:
* <''SVCNAME''>_SERVICE_HOST
* <''SVCNAME''>_SERVICE_PORT


=Environment Variables Corresponding to Other Services=
=Environment Variables Corresponding to Other Services=

Revision as of 20:34, 26 February 2018

External

Internal

Overview

Environment variables can be declared in:

They can also be set with:

oc set env

Some environment variables are automatically exported:

Environment Variables Corresponding to Other Services

TOMCAT2_PORT=tcp://172.30.29.184:8080
TOMCAT2_PORT_8080_TCP=tcp://172.30.29.184:8080
TOMCAT2_PORT_8080_TCP_ADDR=172.30.29.184
TOMCAT2_PORT_8080_TCP_PORT=8080
TOMCAT2_PORT_8080_TCP_PROTO=tcp
TOMCAT2_PORT_8443_TCP=tcp://172.30.29.184:8443
TOMCAT2_PORT_8443_TCP_ADDR=172.30.29.184
TOMCAT2_PORT_8443_TCP_PORT=8443
TOMCAT2_PORT_8443_TCP_PROTO=tcp
TOMCAT2_PORT_8778_TCP=tcp://172.30.29.184:8778
TOMCAT2_PORT_8778_TCP_ADDR=172.30.29.184
TOMCAT2_PORT_8778_TCP_PORT=8778
TOMCAT2_PORT_8778_TCP_PROTO=tcp
TOMCAT2_SERVICE_HOST=172.30.29.184
TOMCAT2_SERVICE_PORT=8080
TOMCAT2_SERVICE_PORT_8080_TCP=8080
TOMCAT2_SERVICE_PORT_8443_TCP=8443
TOMCAT2_SERVICE_PORT_8778_TCP=8778

Note that the environment variables corresponding to a specific service are only injected in a pod if the service existed at the time the pod deployment.