November 30, 2017

Hands on OpenShift Origin

Hands on OpenShift Origin

OpenShift is an even-more-popular container cloud. It could be hosted by redhat.com via openshift.com or it can be self-hosted. I'm playing with OpenShift under Fedora 27 Cloud, on a OpenStack.

Starting a Developing Local Cluster

First of all, you surely need to install the OpenShift Origin Client and docker as it's dependency. Under Fedora it's easy:

$ sudo oc cluster up --public-hostname=${floatip} --skip-registry-check=true
Starting OpenShift using openshift/origin:v3.6.0 ...
Pulling image openshift/origin:v3.6.0
Pulled 1/4 layers, 30% complete
Pulled 2/4 layers, 82% complete
Pulled 3/4 layers, 91% complete
Pulled 4/4 layers, 100% complete
Extracting
Image pull complete
OpenShift server started.

The server is accessible via web console at:
    https://floatip:8443

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

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

Here we passed --skip-registry-check=true parameter to oc since we are using an internal registry. Without it, we'll get:

....
-- Checking Docker daemon configuration ... FAIL
   Error: did not detect an --insecure-registry argument on the Docker daemon
   Solution:

     Ensure that the Docker daemon is running with the following argument:
        --insecure-registry 172.30.0.0/16

and that's not good. We are also passing --public-hostname=${floatip} since float IP is used on OpenStack, and we need OpenShift to listen on that address instead of internal address. We may also need to edit the security group policy in OpenStack to allow ingress TCP on default 8443 or your customized port. For example:
Open 8443 Port in OpenStack
By now the OpenShift local cluster should be ready. We can log in with username developer and any password except an empty one.
OpenShift Origin Login Screen

OpenShift Basics

Login into OpenShift CLI

To login into OpenShift CLI, use

$ oc login -u developer

to login as developer account, or replace it with your ${USERNAME}. You can also login as administrator using

$ oc lgoin -u system:admin

and answer the questions. If things go right, we would get

Login successful.

You have one project on this server: "rhap-test-proj"

Using project "${PROJ_NAME}".
Welcome! See 'oc help' to get started.

<WIP>