Skip to content

Instantly share code, notes, and snippets.

@miticojo
Last active August 11, 2017 11:57
Show Gist options
  • Save miticojo/690e2c5e1997a3c23d6a7090ce53a588 to your computer and use it in GitHub Desktop.
Save miticojo/690e2c5e1997a3c23d6a7090ce53a588 to your computer and use it in GitHub Desktop.
Openshift utilities

Export single template

TEMPLATE_NAME='mysql'
oc -n openshift export template $TEMPLATE_NAME --as-template=$TEMPLATE_NAME > $TEMPLATE_NAME.yaml

Export all templates

oc get template -n openshift -o=custom-columns=NAME:.metadata.name | tail -n +2 | xargs -I {} bash -c "oc export template {} --as-template={} -n openshift > {}.yaml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment