KT #2 – Quickly spinning up an OKD cluster

If you want to test or learn about OKD (if you don’t know OKD is the community version of the RedHat OpenShift Platform, the old OpenShift Origin) either Kubernetes, follow this steps to spin up a cluster in the light speed based in Docker containers.

First of all, you need download the oc client tools for your platform at https://www.okd.io/download.html (TIP: If you use Fedora just install origin-clients package with DNF)

UPDATE: I forgot to mention you need to install docker as well

Inside the extracted directory (preferably in your home directory), run the command:

oc cluster up

Wait a few minutes, when you see this message, your cluster is ready

OpenShift server started.

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

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

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

But if you see this error message:

Checking if insecured registry is configured properly in Docker ...
error: did not detect an --insecure-registry argument on the Docker daemon 

For temporarily skip that check and solve it, just run the oc command with this parameter:

oc cluster up --skip-registry-check=true 

For permanent solving, you need to include the insecure registry (like below) option pointing to 172.30.0.0/16 ip in your docker daemon

root 8196 1 4 11:49 ? 00:02:37 /usr/bin/dockerd-current --add-runtime oci=/usr/libexec/docker/docker-runc-current --default-runtime=oci --authorization-plugin=rhel-push-plugin --containerd /run/containerd.sock --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json --selinux-enabled --log-driver=journald --live-restore --storage-driver overlay2 --add-registry docker.io --add-registry registry.fedoraproject.org --add-registry quay.io --add-registry registry.access.redhat.com --add-registry registry.centos.org --insecure-registry 172.30.0.0/16

There are many ways to do that depending of your platform, please check the docker documentation or your platform documentation for more information how to do that.

For Fedora, I just modified this below configuration at /etc/containers/registries.conf and restarted the docker daemon.

[registries.insecure]
registries = ['172.30.0.0/16']


UPDATE 2: Of course, this setup isn’t recommended for use on production environments. For production, read the OKD documentation or go for RedHat OpenShift (Which I recommend).

That’s all folks for today, thanks in advance and stay in tune!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.