Getting Started with OpenShift Origin on Windows

OpenShift
First thing first. Install Docker.

Once Docker is running, add an insecure registry of 172.30.0.0/16:

  • 1) Right click on the Docker icon in the notification area and select Settings…
  • 2) Click on Docker Daemon in the settings dialog
  • 3) Edit the Docker daemon configuration by adding “172.30.0.0/16” to the “insecure-registries”: setting { “registry-mirrors”: [], “insecure-registries”: [ “172.30.0.0/16” ] }
  • 4) Click on Apply and Docker will restart.

docker-daemon-openshift

Once you have successfully done that it is time install the OpenShift client.

  • Download OpenShift client.
  • Extract the content to a folder and place it in your path.
  • That’s it. You are all set.

Now let’s get started hacking your first OpenShift project.

Open a Command window as Administrator and run:
oc cluster up

You will see the following if all went ok.
OpenShift-getting_started

Here are some handy OpenShift CLI commands.

This in no way a complete list of all the OC command. For complete list and OpenShift reference, please click here and here.

Cluster Up
oc cluster up

Cluster Down
oc cluster down

Return information about the current session
oc whoami

Display client and server versions
oc version

End the current server session
oc logout

Start a new session
oc login -u system:admin

Create new Project
oc new-project sample-demo \
--description="This is an example sample project" \
--display-name="Sample OpenShift Demo"

Delete a Project
oc delete project sample-demo

Switch to a project
oc project

Show an overview of the current project
oc status

Display existing projects
oc projects

View all projects you have access to
oc get projects

See a list of all services in the current project
oc get svc

Describe a deployment configuration in detail
oc describe dc nodeapp-1-aqtx7

Create an application using a remote Git repository
Before proceeding, make sure have Git installed on your workstation.
oc new-app https://github.com/your_user/your_git_repo.git

Specify a Git branch to use by appending #dev to the end of the URL
oc new-app https://github.com/your_user/your_git_repo.git#dev

Add labels to the created objects.
oc new-app https://github.com/your_user/your_git_repo.git -l name=hello-world

Create an application from the DockerHub MySQL image
oc new-app mysql

Create multiple applications from a source repository and DockerHub image
oc new-app https://github.com/your_user/your_git_repo.git mysql

Deploying multiple images together in a single pod
oc new-app nginx+mysql

And finally, help about any command
oc help