John_Thai
Mission Specialist
Mission Specialist
  • 691 Views

Why use oc process and oc create when we can just use oc new-app?

Hi, I'm very new to containers and openshift. I've been studying DO180. In chapter 7, the program is showing us how to "Deploying a Multi-container Application on OpenShift Using a Template". 

When creating a new app with a template, it was shown that we process the template then we create the application as follow.
oc process -f templateFile | oc create -f -

However, we can just use oc new-app to create an application with the template
oc new-app -f templateFile

Then why do we use oc process and oc create?

Thank you in advance for you inputs :)

Labels (1)
0 Kudos
1 Reply
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 679 Views

I'm sure someone will correct me if I'm wrong:

oc process -f templateFile | oc create -f -

oc process -f templateFile : This is likely is used because you previously obtained a template (by using oc get template and saving it to a YAML or JSON file) and you pass parameter(s) to it, using oc process -f templateFile -p <parameter>=<val>. This generates a list of resources to create a new application. (It is possible that you made changes to the YAML or JSON file directly.)

| oc create -f - : Pipe the output from the previous command into this one, which creates the application.

oc new-app -f templateFile : Create an application from an existing template; most likely one that you didn't need to directly modify or pass parameters to (although you can, with --param=<val>), so the first commands (oc process and oc create) wouldn't need to be done.

 

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
0 Kudos
Join the discussion
You must log in to join this conversation.