mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
34 lines
838 B
Plaintext
34 lines
838 B
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * openshift_images/using-templates.adoc
|
|
|
|
[id="templates-create-from-existing-object_{context}"]
|
|
= Creating a template from existing objects
|
|
|
|
Rather than writing an entire template from scratch, you can export existing
|
|
objects from your project in YAML form, and then modify the YAML from there by
|
|
adding parameters and other customizations as template form.
|
|
|
|
.Procedure
|
|
|
|
. Export objects in a project in YAML form:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get -o yaml --export all > <yaml_filename>
|
|
----
|
|
+
|
|
You can also substitute a particular resource type or multiple resources instead of `all`.
|
|
Run `oc get -h` for more examples.
|
|
+
|
|
The object types included in `oc get --export all` are:
|
|
+
|
|
* BuildConfig
|
|
* Build
|
|
* DeploymentConfig
|
|
* ImageStream
|
|
* Pod
|
|
* ReplicationController
|
|
* Route
|
|
* Service
|