My e-Notes about DataScience, Machine Learning, Python, Data Analytics, DataStage, DWH and ETL Concepts

Breaking

Tuesday, 26 May 2020

Process OCP (Openshift) Object Template file

In previous post, we have learnt how to create custom template for creating multiple OCP object in one go. Continuing to that, we will learn about processing that template in this post.

Once, you have the template, we need CLI tool such as "oc" or "kubectl" to process the template which will create the OCP object on OCP K8s server cluster.

a. Login to your OCP/K8s cluster server.
b. Run below commands to process the OCP object template if template do not have any parameters

# to list the def of OCP object in tempalte
$ oc process -f <template_file> # to create the object mentioned in above template file in ocp $ oc process -f <template_file> | oc create -f # this will send the def to OCP server to create object

c. Run below commands if template have parameters


# to list the template parameters
oc process --parameters -f <template_file> # to generate the object definition oc process -f <template_file> -p <param_name1>=<value1> -p <param_name2>=<value2> # to create the object in ocp oc process -f <template_file> -p <param_name1>=<value1> -p <param_name2>=<value2> | oc create -f


This is how we can process the template to generate the definition of OCP object and send the definition to OCP cluster to create the objects.


Like the below page to get the update  
Facebook Page      Facebook Group      Twitter Feed      Telegram Group


No comments:

Post a comment

Disclaimer

The postings on this site are my own and don't necessarily represent IBM's or other companies positions, strategies or opinions. All content provided on this blog is for informational purposes and knowledge sharing only.
The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of his information.