Bug 1373117

Summary: Getting Openshift project name in the template- https://trello.com/c/zcRQFri0/916-2-namespace-template-parameter
Product: OpenShift Container Platform Reporter: Miheer Salunke <misalunk>
Component: RFEAssignee: Dan McPherson <dmcphers>
Status: CLOSED DUPLICATE QA Contact: Johnny Liu <jialiu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: aos-bugs, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-05 09:27:04 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:

Description Miheer Salunke 2016-09-05 09:17:16 UTC
1. Proposed title of this feature request
=> Getting Openshift project name in the template




3. What is the nature and description of the request?
=>  One of our customers got an template to install an application. Additionally they would like to add a route  which is pretty easy. But the host URL should be an combination of Openshift build namespace and static host address.

They wanted to get this build namespace  it in the template for route creation?


So I suggested them 2 choices -
1) specify the route hostname explicitly in a static manner
1b) which is "specify it explicitly but include a ${PARAM} reference in the field and make the user specify the PARAM when instantiating the template"
For a namespace in a template you should be able to reference it like ${NAMESPACE}.  That's what some of the existing example templates do.
like https://github.com/pweil-/origin/blob/f7f5dcfb081d50f47cf068c4376b63c9a43ce153/examples/jenkins/application-template.json#L187-L187


2) don't specify it and let openshift assign it based on the route name.

The auto-generated route hostname is something like routename-projectname.cluster.domain.com which sounds pretty close as to what you want.
Eg- App deployed using PHP template
http://gluster-demo-php-test.router.default.svc.cluster.local
where gluster-demo-php is application name and test is project name and rest is domain.



But now they say that it is not exactly what they are looking for.

They say the first option is setting the a parameter and use it afterwards in the template. So the user have to fill up this field and has to remember the name of his Openshift project.

They say second option is too auto generated. We need to set our internal router name.

They read about downward api, but have no clue how to use it in the template for creating a route and to set there the host name?

Or is it possible to set the env variables of the container and create the route from script out of the container?

Does anyone have any further ideas?


They want to do this over the webconsole.
The issue is that in the webconsole the downward api can't be used, as far as I know.




7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
=>https://trello.com/c/zcRQFri0/916-2-namespace-template-parameter

Comment 2 Miheer Salunke 2016-09-05 09:27:04 UTC

*** This bug has been marked as a duplicate of bug 1331268 ***