Installing OKD

First of all, you will need to download and install the bundle for your operating system, whether it's any of the following:

  • Linux
  • macOS X
  • Windows

Here is the link https://www.okd.io/download.html.

At the time of writing, the latest version of OKD is v3.11.0 build 0cbc58b. You may download a newer version, with a few updates and changes.

Also, keep in mind that in this book, we will provide instructions and examples that will run on a Linux system, so there might be some differences if you are running a different OS platform:

  1. Once we have downloaded the bundle and unpacked it wherever we want, we will refer to its installation folder as OKD_HOME.

Let's check the bundle by looking at what it contains:

# cd $OKD_HOME
# ll
total 235116
-rwxrwxr-x. 1 luigi luigi 120350344 Oct 10 18:48 kubectl
-rw-rwxr--. 1 luigi luigi 10759 Oct 10 18:48 LICENSE
-rwxrwxr-x. 1 luigi luigi 120350344 Oct 10 18:48 oc
-rw-rwxr--. 1 luigi luigi 15834 Oct 10 18:48 README.md

Apart from the README.md and LICENSE files, we have the main files, which are the Kubernetes control tool named kubectl.exe and the OKD command-line tool named oc.

The oc tool is our first management tool to start, stop, configure, and manage the OpenShift cluster. OpenShift uses the Kubernetes API to orchestrate containers in its way, so that's why we also have the Kubernetes control tool.

  1. Test the installation as follows:
# cd $OKD_HOME
# ./oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO
  1. One important thing: you absolutely need Docker installed on your PC. In my environment, I'm running the following Docker version:
# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-60.git9cb56fd.fc27.x86_64
Go version: go1.9.7
Git commit: 9c9378f-unsupported
Built: Sun Jul 8 08:52:30 2018
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-60.git9cb56fd.fc27.x86_64
Go version: go1.9.7
Git commit: 9c9378f-unsupported
Built: Sun Jul 8 08:52:30 2018
OS/Arch: linux/amd64
Experimental: false

If you don't have Docker, you can download it from https://www.docker.com/get-started.

Let's go back to our container platform OKD and let's run it for the first time. It might take some time as it will need to download all the Docker images to run our platform as containerized.

  1. Open a Terminal window and do the following:
# ./oc cluster up
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11 ...
I1107 10:02:17.533327 29872 config.go:40] Running "create-master-config"
I1107 10:02:19.950416 29872 config.go:46] Running "create-node-config"
I1107 10:02:20.837991 29872 flags.go:30] Running "create-kubelet-flags"
I1107 10:02:21.342993 29872 run_kubelet.go:49] Running "start-kubelet"
I1107 10:02:21.596927 29872 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
ae999762568bI1107 10:06:21.628135 29872 interface.go:26] Installing "kube-proxy" ...
I1107 10:06:21.628195 29872 interface.go:26] Installing "kube-dns" ...
I1107 10:06:21.628235 29872 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I1107 10:06:21.628275 29872 interface.go:26] Installing "openshift-apiserver" ...
I1107 10:06:21.628576 29872 apply_template.go:81] Installing "kube-dns"
I1107 10:06:21.628571 29872 apply_template.go:81] Installing "openshift-service-cert-signer operator"
I1107 10:06:21.628571 29872 apply_template.go:81] Installing "openshift-apiserver"
I1107 10:06:21.628861 29872 apply_template.go:81] Installing "kube-proxy"
I1107 10:06:24.734288 29872 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
I1107 10:08:05.759760 29872 run_self_hosted.go:242] openshift-apiserver available
I1107 10:08:05.759791 29872 interface.go:26] Installing "openshift-controller-manager" ...
I1107 10:08:05.759814 29872 apply_template.go:81] Installing "openshift-controller-manager"
I1107 10:08:08.170568 29872 interface.go:41] Finished installing "openshift-controller-manager"
Adding default OAuthClient redirect URIs ...
Adding centos-imagestreams ...
Adding router ...
Adding persistent-volumes ...
Adding registry ...
Adding sample-templates ...
Adding web-console ...
I1107 10:08:08.206912 29872 interface.go:26] Installing "centos-imagestreams" ...
I1107 10:08:08.206937 29872 interface.go:26] Installing "openshift-router" ...
I1107 10:08:08.206949 29872 interface.go:26] Installing "persistent-volumes" ...
I1107 10:08:08.206960 29872 interface.go:26] Installing "openshift-image-registry" ...
I1107 10:08:08.206971 29872 interface.go:26] Installing "sample-templates" ...
I1107 10:08:08.206979 29872 interface.go:26] Installing "openshift-web-console-operator" ...
I1107 10:08:08.207255 29872 apply_list.go:67] Installing "centos-imagestreams"
I1107 10:08:08.207622 29872 interface.go:26] Installing "sample-templates/mongodb" ...
I1107 10:08:08.207642 29872 interface.go:26] Installing "sample-templates/mariadb" ...
I1107 10:08:08.207651 29872 interface.go:26] Installing "sample-templates/mysql" ...
I1107 10:08:08.207661 29872 interface.go:26] Installing "sample-templates/cakephp quickstart" ...
I1107 10:08:08.207673 29872 interface.go:26] Installing "sample-templates/dancer quickstart" ...
I1107 10:08:08.207684 29872 interface.go:26] Installing "sample-templates/django quickstart" ...
I1107 10:08:08.207695 29872 interface.go:26] Installing "sample-templates/nodejs quickstart" ...
I1107 10:08:08.207705 29872 interface.go:26] Installing "sample-templates/postgresql" ...
I1107 10:08:08.207715 29872 interface.go:26] Installing "sample-templates/rails quickstart" ...
I1107 10:08:08.207725 29872 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ...
I1107 10:08:08.207735 29872 interface.go:26] Installing "sample-templates/sample pipeline" ...
I1107 10:08:08.207790 29872 apply_list.go:67] Installing "sample-templates/sample pipeline"
I1107 10:08:08.208061 29872 apply_list.go:67] Installing "sample-templates/mongodb"
I1107 10:08:08.208226 29872 apply_list.go:67] Installing "sample-templates/mariadb"
I1107 10:08:08.208246 29872 apply_template.go:81] Installing "openshift-web-console-operator"
I1107 10:08:08.208475 29872 apply_list.go:67] Installing "sample-templates/cakephp quickstart"
I1107 10:08:08.208677 29872 apply_list.go:67] Installing "sample-templates/nodejs quickstart"
I1107 10:08:08.208703 29872 apply_list.go:67] Installing "sample-templates/postgresql"
I1107 10:08:08.210179 29872 apply_list.go:67] Installing "sample-templates/dancer quickstart"
I1107 10:08:08.210319 29872 apply_list.go:67] Installing "sample-templates/rails quickstart"
I1107 10:08:08.210321 29872 apply_list.go:67] Installing "sample-templates/django quickstart"
I1107 10:08:08.208377 29872 apply_list.go:67] Installing "sample-templates/mysql"
I1107 10:08:08.208401 29872 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral"
I1107 10:08:17.213093 29872 interface.go:41] Finished installing "sample-templates/mongodb" "sample-templates/mariadb" "sample-templates/mysql" "sample-templates/cakephp quickstart" "sample-templates/dancer quickstart" "sample-templates/django quickstart" "sample-templates/nodejs quickstart" "sample-templates/postgresql" "sample-templates/rails quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/sample pipeline"
I1107 10:08:39.004121 29872 interface.go:41] Finished installing "centos-imagestreams" "openshift-router" "persistent-volumes" "openshift-image-registry" "sample-templates" "openshift-web-console-operator"
Login to server ...
Creating initial project "myproject" ...
Server Information ...
OpenShift server started.

The server is accessible via the Web console at https://127.0.0.1:8443.

You are logged in as the following:

User: developer
Password: <any value>
  1. To log in as administrator, use the following:
oc login -u system:admin

Let's analyze the most important aspects. There are a lot of logs, but it has done many tasks for you.

First of all, the command—we rely on the oc cluster command to run the cluster. Why a cluster? Because oc runs several containers, that is, several servers, with networks, routing, storage, container registry, and so on. It is much, much easier than providing everything yourself and then configuring a Kubernetes cluster.

The oc command also comes with several other flags to help you out, as follows:

# ./oc --help
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset