macOS

The installation and configuration process for macOS is very similar to that for Linux. It assumes that Docker for macOS is being used. The deployment process involves the following:

  • Docker for macOS installation and configuration
  • Installation of openshift-cli and required packages
  • Starting a cluster
The oc cluster up command requires Docker to be installed on your system, because essentially, it creates a Docker container and runs OpenShift inside that Docker container. It is a very elegant and clean solution.

The Docker for macOS installation process is described at the official portal:  https://docs.docker.com/docker-for-mac.

Once the Docker service is running, you need to configure the insecure registry (172.30.0.0/16). From the Docker menu in the toolbar, you need to select the Preferences menu and click on the Daemon icon. In the Basic tab of the configuration dialog, click on the + icon under Insecure registries and add the following new entry: 172.30.0.0/16:

When finished, click on Apply & Restart

Once the Docker service is configured, we need to install all the required software and start the cluster using the following steps:

  1. OpenShift client installation: Install the socat and openshift-cli packages on your system as follows:
$ brew install openshift-cli socat --force
If you do not have brew installed, find the installation process at  https://brew.sh/.
  1. Starting and stopping the OpenShift cluster: The cluster can be started just like it was in Linux:
$ oc cluster up
Starting OpenShift using registry.access.redhat.com/openshift3/ose:v3.7.23 ...
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
At the time of writing this book,  oc cluster up on macOS didn't work for version 3.9. I would recommend you to temporarily use 3.7 version of the client utility.

An installation verification can be performed by the OpenShift admin user, as follows:

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

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

default
kube-public
kube-system
* myproject
openshift
openshift-infra
openshift-node

Using project "myproject".

The Openshift cluster is up and ready for work. We may check the status of the cluster using the following command:

$ oc get nodes
NAME STATUS AGE VERSION
localhost Ready 20h v1.7.6+a08f5eeb62

The cluster can be stopped as follows:

$ oc cluster down