OpenShift Environment Variables: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 22: Line 22:
* <''SVCNAME''>_SERVICE_HOST
* <''SVCNAME''>_SERVICE_HOST
* <''SVCNAME''>_SERVICE_PORT
* <''SVCNAME''>_SERVICE_PORT
=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.

Revision as of 23:49, 5 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:

  • <SVCNAME>_SERVICE_HOST
  • <SVCNAME>_SERVICE_PORT

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.