Bug 1331268

Summary: Allow namespace parameter as a reference to other objects in the template.
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: RFEAssignee: Ben Parees <bparees>
Status: CLOSED DEFERRED QA Contact: Johnny Liu <jialiu>
Severity: medium Docs Contact:
Priority: high    
Version: 3.1.0CC: aos-bugs, bparees, jkaur, jokerman, mbarrett, misalunk, mmccomas
Target Milestone: ---Flags: erich: needinfo? (jkaur)
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-12 13:54:36 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 Jaspreet Kaur 2016-04-28 07:28:14 UTC
3. What is the nature and description of the request?  

  Some objects need knowledge of the namespace being deployed into. It should allow to reference the namespace in the template without needing to pass it in as a regular parameter,

    name: gluster-recycler
  subjects:
  - kind: ServiceAccount
    name: gluster-recycler
    namespace: ${NAMESPACE}
  userNames:
  - system:serviceaccount:${NAMESPACE}:gluster-recycler



4. Why does the customer need this? (List the business requirements here)
We wish to create template that can create service accounts and other objects that need the namespace as a reference.				
						
5. How would the customer like to achieve this? (List the functional requirements here)
We would like an automatic parameter available containing the namespace being deployed into.
It might also be useful to have the deployers userid available as another automatic parameter and perhaps there are others.					
						
6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Write a template which uses the automatic parameter as a label or something like that.		
						
7. Is there already an existing RFE upstream or in Red Hat Bugzilla?	
Not aware of one.					
						
8. Does the customer have any specific timeline dependencies and which release would they like to target?
3.3				
						
10. List any affected packages or components.	
Openshift Templates					
						
11. Would the customer be able to assist in testing this functionality if implemented?
yes

Comment 2 Miheer Salunke 2016-09-05 09:24:14 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 4 Miheer Salunke 2016-09-05 09:27:04 UTC
*** Bug 1373117 has been marked as a duplicate of this bug. ***

Comment 10 Eric Rich 2018-03-12 13:54:36 UTC
This bug has been identified as a dated (created more than 3 months ago) bug. 
This bug has been triaged (has a trello card linked to it), or reviewed by Engineering/PM and has been put into the product backlog, 
however this bug has not been slated for a currently planned release (3.9, 3.10 or 3.11), which cover our releases for the rest of the calendar year. 

As a result of this bugs age, state on the current roadmap and PM Score (being below 70), this bug is being Closed - Differed, 
as it is currently not part of the products immediate priorities.

Please see: https://docs.google.com/document/d/1zdqF4rB3ea8GmVIZ7qWCVYUaQ7-EexUrQEF0MTwdDkw/edit for more details.