Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1417319 - Missing OPENSHIFT_NODEJS_* variables
Summary: Missing OPENSHIFT_NODEJS_* variables
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Networking
Version: 3.x
Hardware: All
OS: All
Target Milestone: ---
: ---
Assignee: Ben Bennett
QA Contact: Meng Bo
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-27 23:56 UTC by Dmitry
Modified: 2017-01-30 15:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-01-30 15:35:13 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Dmitry 2017-01-27 23:56:07 UTC
Description of problem:
Necessary environment variables are missing.

Version-Release number of selected component (if applicable):

How reproducible:
Just create and start a Node.js 4 pod. It will use a boilerplate project  https://github.com/openshift/nodejs-ex , where HTTP service rely on missing OPENSHIFT_NODEJS_PORT variable and taking 8080 port as default fallback. In the v3 documentation there is a rule - use <SVC_NAME>_SERVICE_PORT variables ( https://docs.openshift.com/online/dev_guide/environment_variables.html ), for example MYPROJECT123_SERVICE_PORT . But it is very ugly solution to inject project name into source code.

Actual results:
No way to get network interface port I should listen while starting HTTP or WS services in my Node.js applications. 

Expected results:
Something like OPENSHIFT_NODEJS_PORT in v2.

Comment 1 Ben Bennett 2017-01-30 15:35:13 UTC
I'm sorry, but that's how OpenShift is designed.  You can set custom environment variables on the rcs, dcs or pods if you want.  Or you could name your service differently.

There is work going on to implement a service catalog, and that may address the linking problem you identified.

Note You need to log in before you can comment on or make changes to this bug.