Oc create: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
oc create can be used from command line, combined with echo, to create OpenShift object while experimenting. You can copy-and-paste a multi-line YAML declaration, and then use:
oc create can be used from command line, combined with echo, to create OpenShift object while experimenting. You can copy-and-paste a multi-line YAML declaration, and then use:


  echo "'''paste'''" | oc create -f -
  echo "''paste''" | oc create -f -


=Creating a Resource Quota=
=Creating a Resource Quota=

Revision as of 21:19, 8 December 2017

Internal

Overview

Command Line Usage

oc create can be used from command line, combined with echo, to create OpenShift object while experimenting. You can copy-and-paste a multi-line YAML declaration, and then use:

echo "paste" | oc create -f -

Creating a Resource Quota

oc create -f quota-def-file.json --namespace=my-project

Really? It sounds like creating the objects in specified in the file.

Uploads a Template to the Project Template Library

oc create -f template-file.json
oc process -f ./file.yaml [--param PARAM1=value1 ...] | oc create -f -

Create a S2I Build

oc new-app -o json ...
oc create -f .../s2i.json

oc new-app should be used to create the build directly, this is the preferred approach.

Create a Service Account

Create a Service Account