Bug 1417319 - Missing OPENSHIFT_NODEJS_* variables
Summary: Missing OPENSHIFT_NODEJS_* variables
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Networking
Version: 3.x
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
: ---
Assignee: Ben Bennett
QA Contact: Meng Bo
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2017-01-30 15:35:13 UTC
Target Upstream Version:
Embargoed:


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):
3

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.