Skip to Content
Learn OpenShift
book

Learn OpenShift

by Denis Zuev, Artemii Kropachev, Aleksey Usov
July 2018
Intermediate to advanced
504 pages
11h 34m
English
Packt Publishing
Content preview from Learn OpenShift

Using the oc new-app -o command

By default, the oc new-app command creates all of the resources required for a project. You can modify this behavior and get the utility to create a resource definition file, instead of creating resources:

$ oc new-app httpd -o yaml | head -n 20apiVersion: v1items:- apiVersion: v1  kind: DeploymentConfig  metadata:    annotations:      openshift.io/generated-by: OpenShiftNewApp    creationTimestamp: null    labels:      app: httpd    name: httpd  spec:    replicas: 1    selector:      app: httpd      deploymentconfig: httpd    strategy:      resources: {}    template:      metadata:
This doesn't create an OpenShift template, but it can be used to create a skeleton of the template's structure.

Clear out your your project environment, before we proceed.

# oc delete ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Operating OpenShift

Operating OpenShift

Rick Rackow, Manuel Dewald
OpenShift for Developers, 2nd Edition

OpenShift for Developers, 2nd Edition

Joshua Wood, Brian Tannous
Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower

Publisher Resources

ISBN: 9781788992329Supplemental Content