OpenShift / Kubernetes explanation for each of the template fields

7/9/2018

Sorry if this sounds like I'm lazy, but I've search around, around and around, but couldn't find it!

I'm looking for a reference that explains each of the fields that may exist in an OpenShift / Kubernetes template, e.g. what possible values there are.

-- His
kubernetes
openshift

1 Answer

7/9/2018

The templates you get in OpenShift are OpenShift specific and not part of Kubernetes. If you mean the purpose of each of the possible fields you can specify for a parameter, you can run oc explain template. For example:

$ oc explain template.parameters
RESOURCE: parameters <[]Object>

DESCRIPTION:
     parameters is an optional array of Parameters used during the Template to
     Config transformation.

     Parameter defines a name/value variable that is to be processed during the
     Template to Config transformation.

FIELDS:
   description  <string>
     Description of a parameter. Optional.

   displayName  <string>
     Optional: The name that will show in UI instead of parameter 'Name'

   from <string>
     From is an input value for the generator. Optional.

   generate <string>
     generate specifies the generator to be used to generate random string from
     an input value specified by From field. The result string is stored into
     Value field. If empty, no generator is being used, leaving the result Value
     untouched. Optional. The only supported generator is "expression", which
     accepts a "from" value in the form of a simple regular expression
     containing the range expression "[a-zA-Z0-9]", and the length expression
     "a{length}". Examples: from | value -----------------------------
     "test[0-9]{1}x" | "test7x" "[0-1]{8}" | "01001100" "0x[A-F0-9]{4}" |
     "0xB3AF" "[a-zA-Z0-9]{8}" | "hW4yQU5i"

   name <string> -required-
     Name must be set and it can be referenced in Template Items using
     ${PARAMETER_NAME}. Required.

   required <boolean>
     Optional: Indicates the parameter must have a value. Defaults to false.

   value    <string>
     Value holds the Parameter data. If specified, the generator will be
     ignored. The value replaces all occurrences of the Parameter ${Name}
     expression during the Template to Config transformation. Optional.

You can find more information in:

If that isn't what you mean, you will need to be more specific as to what you mean. If you are talking about fields on any resource object (templates are specific type of resource object in OpenShift), you can use oc explain on any of them, pass the name of the resource type as argument, and then a dotted path as you traverse into fields. If using plain Kubernetes, you can use kubectl explain.

-- Graham Dumpleton
Source: StackOverflow