How to order the creation of objects in an Openshift template How to order the creation of objects in an Openshift template kubernetes kubernetes

How to order the creation of objects in an Openshift template


According to documentation:

If an object definition’s metadata includes a fixed namespace field value, the field will be stripped out of the definition during template instantiation. If the namespace field contains a parameter reference, normal parameter substitution will be performed and the object will be created in whatever namespace the parameter substitution resolved the value to, assuming the user has permission to create objects in that namespace.

So just specify required namespaces as template's parameters. Usable example:

apiVersion: template.openshift.io/v1kind: Templatemetadata:  name: yyyparameters:- name: ns3  value: test3objects:- apiVersion: v1  kind: Namespace  metadata:    name: ${ns3}  spec:    finalizers:    - kubernetes- apiVersion: v1  data:    key3: value3  kind: ConfigMap  metadata:    namespace: ${ns3}    name: cm3