Skip to content

Instantly share code, notes, and snippets.

@aweiteka
Created December 23, 2015 15:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aweiteka/a8bf75930e235879bcdd to your computer and use it in GitHub Desktop.
Save aweiteka/a8bf75930e235879bcdd to your computer and use it in GitHub Desktop.
Exporting OpenShift to Kubernetes

Exporting an application from OpenShift to Kubenetes

OpenShift v3 is based on Kubernetes, adding additional objects such as builds, routes and image streams.

Metadata

Common objects or data types

  • pods
  • replication controllers (rc)
  • services (svc)
  • persistent volumes (pvc)
  • labels

Export from OpenShift

This command exports the common objects as a json template (could be yaml), piping the output to a file. The template file may be edited as necessary.

oc export pods,rc,svc,pvc,labels --as-template=<arbitrary_template_name> -o json > myapp.json

Import or Create on Kubernetes

This command creates all of the objects on a kubernetes cluster.

kubectl create -f myapp.json

Images

Images are typically stored in the integrated OpenShift registry. If these images are not accessible by the kubernetes cluster they may need to be pulled from the OpenShift registry and pushed to another registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment