Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • OpenShift Templates: Set parameter values with the help of a second file

    Posted on

    Hey guys,

    So I am in the situation where I have an OpenShift Template with a lot of parameters. Depending on the situation and environment I am working with, I would like to set these to different values. Currently I am doing this is by just overwriting them with the "-p" flag when processing the template with the oc command. So for example I would do something like this

    Environment 1

    oc process -f template-location.yaml -p PARAMETER1=environment1value -p PARAMETER2=environment1value ... | oc create -f -
    

    Environment 2

    oc process -f template-location.yaml -p PARAMETER1=environment2value -p PARAMETER2=environment2value ... | oc create -f -
    

    ...and so forth for every other environment.

    What I would like to know was, whether it is possible to offload the value of these parameters in to a separate file (maybe yaml or json aswell) and read them in from there. So that for example something similar to this is possible (Note: the "-p" switch there is just meant as a stand in):

    Environment 1

    oc process -f template-location.yaml -p environment1-values.yaml  | oc create -f -
    

    Environment 2

    oc process -f template-location.yaml -p environment2-values.yaml  | oc create -f -
    

    Especially from a DevOps perspective this would be really nice, as you could just check-in the value files into VCS as well.

    Is there a functionality like this? Or do you guys maybe have an even better idea? Unfortunately I could not find anything in the documentation.

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat