Do objects created from an Openshift template overwrite existing objects?

1/20/2020

I took a look at the Openshift documentation, but I couldn't find out what exactly happens when a template is processed and the objects defined in it created. More specifically: what happens to existing objects (created in a previous deployments)? Are they overwritten completely or edited/patched?

-- alexaand
deployment
kubernetes
openshift

1 Answer

1/22/2020

During oc process you just pass template's parameters (see templates) and generate final list of objects. Then the list of objects can be passed to oc create or apply. oc create should be used to create new objects or returns 'already exists'. oc apply can create/update existing objects.

oc process -f <filename> | oc create -f -

In case of DeploymentConfig if you have config change trigger it will start deployment after oc apply

-- Oligzeev
Source: StackOverflow