[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Q: Refer to runtime properties from within "templates"?

Terminology: I tend to call the YAML/JSON files used in `oc apply -f ...`: YAML Files, Object Files, Object Definition Files, API Object Files.  OpenShift also has multiple concepts of Template Files in the form of jinja files (which produce YAML Files) and multiple API Object Files in a single file YAML file, and parameterized API Object Files that contain a `parameters:` section one or more API Object Definitions [0].

I find the latter especially useful.  You can create an entire Application Lifecycle Landscape (DEV, QA, PROD) and the requisite API Objects (bc, dc, svc, etc.) in one call to `oc process -f ... | oc appy -f -` with full parameterization [1].  Every single API Object can be created this way, and, you can add them to the OpenShift project namespace `openshift` and make your templates available to other users of the cluster (using `oc create template -f myTemplate.yaml`).

[0] https://docs.openshift.com/container-platform/3.6/dev_guide/templates.html#writing-templates
[1] https://docs.openshift.com/container-platform/3.6/dev_guide/templates.html#generating-a-list-of-objects




Red Hat Consulting, NA US WEST

lpsantil gmail com    M: 3236334854    

On Thu, Oct 19, 2017 at 8:39 AM, Tako Schotanus <tschotan redhat com> wrote:

is it possible in some way to refer to actual runtime values from within an OpenShift template (I'm calling it templates because I don't know the official terminology. I'm referring to the json/yaml files that can be applied using "oc apply" for example).

What I'm really trying to do is to figure out what hostname was used for a Route that was created using an earlier apply and use it in the template that is to be applied.

I'm guessing there's no such thing, but I want to make sure before coming up with some kind of system ourselves to do replacements in template files.





Red Hat 

users mailing list
users lists openshift redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]