OpenShift Origin Project(s) getting lost on bringing cluster down and up again

757 views Asked by At

I have a basic query here regarding durability of projects created on OpenShift origin. Have a very basic setup instantiated with below command:

oc cluster up --create-machine

After that i create a project TestProject and deployed an image (nginx) from

Add to Project -> Deploy Image

option from OpenShift Origin Console. Now when i brought down the cluster with below command and brought up again, my project (TestProject) is lost and I only see a default project by the name My Project every time i bring the cluster up.

oc cluster down --docker-machine=openshift

oc cluster up --docker-machine=openshift

Is this an expected behavior? Do I need to use something like persistent volume or such stuffs, am quiet new to OpenShift origin, hence requesting for guidance on this.

Platform:

  • macOS Sierra 10.12.1
  • oc v1.4.0-rc1+b4e0954
  • Docker Version: 1.12.3
1

There are 1 answers

1
Graham Dumpleton On BEST ANSWER

When using oc cluster up, by default anything you do in it will be thrown away when the cluster is brought down. It is only intended for testing in its default state. If you want to persist applications across restarts of the cluster when using oc cluster up, you need to tell it to save away data in a directory and what the directory is.

You can find more information about this in:

If you want a script which simplifies management of this task see:

BTW. Recommend not using docker-machine on MacOS X as you can't do volume mounting easily. Use Docker for Mac by itself instead. That wrapper script will help you with that and volume management as well.