(Last Updated On: May 4, 2019)

How do I install OpenShift Origin on Ubuntu 19.04/18.04/16.04?. OpenShift Origin (OKD) is an Open Source implementation of Red Hat OpenShift. In a nutshell, it is the community distribution of Kubernetes optimized for developing, deploying, and managing container-based applications. Openshift gives you a self-service platform to create, modify, and deploy applications on demand.

Similar: How to run Local Openshift Cluster with Minishift

OpenShift aims at ensuring there is faster development and release life cycles. This guide has been written to guide you through the installation of single node OpenShift Origin on Ubuntu 18.04 / 16.04. This setup is not recommended for production use. Refer to Openshift Origin Cluster installation for production use.

Step 1: Install Docker CE on Ubuntu

A single node installation will run all OKD services in docker containers. Docker Engine runtime is required on the host system.

Import Docker GPG key.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Once it is imported, add Docker APT repository to your Ubuntu 18.04 system.

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

The Docker repository is now added, run the commands below to update system and install Docker CE on Ubuntu.

sudo apt update && sudo apt -y install docker-ce

Verify your Docker Engine installation.

$ docker version
Client:
Version: 18.09.3
API version: 1.39
Go version: go1.10.8
Git commit: 774a1f4
Built: Thu Feb 28 06:53:11 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.3
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 774a1f4
Built: Thu Feb 28 05:59:55 2019
OS/Arch: linux/amd64
Experimental: false

Add your User account to docker group.

sudo usermod -aG docker $USER

Step 2: Download OpenShift Origin on Ubuntu 19.04/18.04/16.04

Download the OpenShift client utility (oc) which is used to bootstrap Openshift Origin on Ubuntu. As of this writing, the most recent release is 3.11.0 .

wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz

Uncompress downloaded file.

tar xvf openshift-origin-client-tools*.tar.gz

Switch to created folder and copy kubectl and oc binaries to the /usr/local/bin directory.

cd openshift-origin-client*/
sudo mv oc kubectl /usr/local/bin/

Verify installation of OpenShift client utility.

$ oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Allow use of Insecure Docker registry.

cat << EOF | sudo tee /etc/docker/daemon.json 
{
"insecure-registries" : [ "172.30.0.0/16" ]
}
EOF

Restart Docker service after adding the file.

sudo systemctl restart docker

Start OpenShift Origin All-in-One Server

Start OKD server by running the following command:

$ oc cluster up

The command above will:

  • Start OKD Cluster listening on local interface – 127.0.0.1:8443
  • Start a web console listening on all interfaces at /console (127.0.0.1:8443).
  • Launch Kubernetes system components.
  • Provisions registry, router, initial templates, and a default project.

There are a number of options which can be applied when setting up Openshift Origin, view them with:

$ oc cluster up --help

On a successful installation, you should get output similar to below.

Login to server …
Creating initial project "myproject" …
Server Information …
OpenShift server started.
The server is accessible via web console at:
https://127.0.0.1:8443
You are logged in as:
User: developer
Password: <any value>
To login as administrator:
oc login -u system:admin

Example below uses custom options.

$ oc cluster up --routing-suffix=<ServerPublicIP>.xip.io \
--public-hostname=<ServerPulicDNSName>

Or Just public/Private IP

oc cluster up --public-hostname=192.168.10.10

OpenShift cluster configuration files will be located inside the openshift.local.clusterup/ directory.

To login as administrator, use:

$ oc login -u system:admin
Logged into "https://116.203.125.128:8443" as "system:admin" using existing credentials.
You have access to the following projects and can switch between them with 'oc project ':
* default
kube-dns
kube-proxy
kube-public
kube-system
myproject
openshift
openshift-apiserver
openshift-controller-manager
openshift-core-operators
openshift-infra
openshift-node
openshift-service-cert-signer
openshift-web-console
Using project "default.

Change to the default project:

oc project default

Deploy OKD cluster integrated container image registry if it doesn’t exist.

$ oc adm registry
Docker registry "docker-registry" service exists

Check current project status.

$ oc status
In project default on server https://192.168.10.10:8443
svc/docker-registry - 172.30.1.1:5000
dc/docker-registry deploys docker.io/openshift/origin-docker-registry:v3.11
deployment #1 deployed about an hour ago - 1 pod
svc/kubernetes - 172.30.0.1:443 -> 8443
svc/router - 172.30.119.192 ports 80, 443, 1936
dc/router deploys docker.io/openshift/origin-haproxy-router:v3.11
deployment #1 deployed about an hour ago - 1 pod
View details with 'oc describe /' or list everything with 'oc get all'.

Creating a Project on OKD

Now that we have OKD installed and working, we can test the deployment by deploying a test project. Switch to test user account.

$ oc login
Authentication required for https://116.203.125.128:8443 (openshift)
Username: developer
Password: developer
Login successful.

Confirm if Login was successful.

$ oc whoami
developer

Create a new project using oc new-project command.

$ oc new-project dev --display-name="Project1 - Dev" --description="My Dev Project"

Access Admin Console in a browser

OKD includes a web console which you can use for creation and management actions. This web console is accessible on Server IP/Hostname on the port,8443 via https.

https://<IP|Hostname>:8443/console

You should see an OpenShift Origin window with Username and Password forms, similar to this one:

Login with:

Username: developer
Password: developer

You should see a dashboard similar to below.

A Project can be created from the web console.

Give it a name, optional Display Name, and Description. If you click on Project name, you should get to the Project management dashboard where you can Browse Catalog, Deploy Image and Import YAML/JSON.

Status of deployed Project can be viewed from CLI.

$ oc login
$ oc project <projectname>
$ oc status
In project My Project (myproject) on server https://116.203.125.128:8443
svc/parksmap-katacoda - 172.30.144.250:8080
dc/parksmap-katacoda deploys istag/parksmap-katacoda:1.0.0
deployment #1 deployed 4 minutes ago - 1 pod
2 infos identified, use 'oc status --suggest' to see details.

Read OpenShift Origin documentation and stay connected for more updates. You can also check related articles below.

How to run Local Openshift Cluster with Minishift

How to setup 3 node Kubernetes Cluster on Ubuntu 18.04 with Weave Net CNI

How to Install Podman on Ubuntu

How to Install and use Rancher 2 on Ubuntu