StackLeader Blog

Post Image
Apr 11, 2017

Getting started with OpenShift Origin


The OpenShift cli contains a convenient utility for testing an OpenShift cluster. This guide will demonstrate how to setup a single node cluster and execute a few commands.

Fedora/Centos/RHEL CLI Installation

Install the following packages

sudo dnf install -y origin-clients docker

Alternative CLI Installation

Download oc cli client and install docker

tar xvf openshift-origin-client-tools-v3.6.0-c4dd4cf-linux-64bit.tar.gz
sudo cp openshift-origin-client-tools-v3.6.0-c4dd4cf-linux-64bit/oc /usr/bin/
sudo chmod +x /usr/bin/oc
sudo dnf install -y docker

Remaining Steps

Add your user to the docker group

sudo groupadd docker
sudo usermod -a -G docker <user name>

Open a new shell. Add an insecure registry to docker in the file /etc/containers/registries.conf

# lists of registries.

# The default location for this configuration file is /etc/containers/registries.conf.

# The only valid categories are: '', 'registries.insecure',
# and 'registries.block'.

registries = ['', '', '']

# If you need to access insecure registries, add the registry's fully-qualified name.
# An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
registries = ['']

# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
# Docker only
registries = []

Start Docker

sudo systemctl start docker

Start OpenShift

$ oc cluster up
Starting OpenShift using openshift/origin:v3.6.0 ...
OpenShift server started.

The server is accessible via web console at:

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin

Login to the cluster as an administrator

$ oc login -u system:admin
Logged into "" as "system:admin" using existing credentials.

You have access to the following projects and can switch between them with 'oc project <projectname>':

  * myproject

Using project "myproject".

Try running the busybox container in your project myproject

$ oc run -i -t busybox --image=busybox --restart=Never echo "hello world"
hello world

If you are running ocp inside a virtual machine, you may find it helpful to bind to a different ip address than localhost.

oc cluster up --public-hostname ''