After being nagged by the gaffer to try OpenShift Origin V3 I finally got round to running a test server using Vagrant on my Mac.
I must say, going into this that the documentation at this stage is struggling a little to keep up with the development and these instructions are the results of much trial, error & Googling.
Also, the product is very much still in active development and there have been several bugs, like this one , which have caused the instructions below not to work.
First off, I am assuming you have Vagrant & VirtualBox installed (if not, go and install now).
I put my Vagrant machines in ~/Machines/ so first of lets create a directory in there so we can checkout the latest release and start the Vagrant machine;
and finally change to root to stop loads of permissions problems later on.
You should be now SSH’ed into a Fedora 21 machine as root, before we start there is a little bit of house keeping we need to do to make sure you are starting from a clean slate. First off, lets install killall as you will need this later;
The Vagrantbox comes with some containers running, so lets clean up;
Now check that everything is gone;
When the Vagrant machine booted it mounted a copy of the code you checked out into itself at /data/src/github.com/openshift/origin so lets change to that directory and install the client tools & server;
So we now have a clean Fedora 21 machine running Docker with the latest release of OpenShift installed. Now its time to deploy actually run something, lets change to the “Sample App” directory and use it as the base for the remaining commands;
The first thing we need to do is pull down the latest version of the Docker images we are going to need to run the example app;
Now we have the latests images lets start up the OpenShift server, load the certificate which was generated by the server starting and finally set some permissions on the config files;
Next up, lets start a Docker Registry;
You can check that the registry is running with the following command;
It may take a few minutes to start, but when it has started you should see an Endpoint listed and not [none].
Once started you can add some permissions for the user test-admin;
and finally login;
Select the default URL and enter the username / password test-admin.
Now we can add the example app project;
Import the project definition;
and finally build the application;
To view the status of the builds you can run the following;
If a build fails, you can just run the start-build command again. Once everything has been build you can view the status by running;
This will show you all of the running containers and is similar to the output you see when running docker -ps. You can also run;
When running the last command make a note of the IP address and port of the front-end.
To view the application exit out of the Vagrant box and then log back in using the following (replacing the IP address of that of the front-end from the osc get services);
Now gotohttp://localhost:9999and you should see the application.
Also, don’t forget there is a web interface available athttps://localhost:8443/console/login using the test-admin username you created earlier.
Finally, when you have finished don’t forget to teardown the application and destroy the sample application (it will leave traces in your working directory) by running the clean up script;
And thats it, you have installed OpenShift 3 and launched a sample application. Its going to be an interesting few months as OpenShift 3 gets closer to release.