Bug 1417319

Summary: Missing OPENSHIFT_NODEJS_* variables
Product: OpenShift Online Reporter: Dmitry <koutsenko>
Component: NetworkingAssignee: Ben Bennett <bbennett>
Status: CLOSED NOTABUG QA Contact: Meng Bo <bmeng>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, koutsenko
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-30 15:35:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.