OCP Part 1: How to install free OpenShift Container Platform Cluster

Jakub Jóźwicki
2 min readJan 17, 2019

You need at least 3 instances of CentOS 7.6: each one with 16GB of RAM and dedicated local SSD to host GlusterFS. We want installation to proceed in an automatic way, so we choose ansible.

OpenShift installation using Ansible

OpenShift Ansible project requires ansible-2.6.5. Latest epel-repo for CentOS (yum install epel-release) contains 2.7 and this version is not compatible. However inside Docker we can run any Red Hat originating OS, for example Fedora 27 with Ansible 2.6.5…

So:

yum install docker
vi Dockerfile
FROM fedora:27
RUN yum -y install ansible git wget patch python2-passlib httpd-tools java-1.8.0-openjdk-headless openssl

then

docker build . -t infra/ocp-ansible

OK. We are ready to run ansible installer.

docker run -it infra/ocp-ansible /bin/bash

We are inside container. If you want to use preconfigured Docker image you can take kubaseai/ocp-ansible instead of your own. You need to adjust inventory hosts file (in /etc/ansible/hosts), with following sections listing your machines:

[masters]
[etcd]
[nodes]
[glusterfs]

If you are just testing OpenShift (but still want full blown setup), you can hack original OpenShift Ansbile to put everything on one machine, just do:

cd openshift-ansible
wget https://github.com/kubaseai/microservice-architecture-demo/raw/master/ocp.diff
patch -p1 < ocp.diff

Oh, where is openshift-ansible from?

git clone https://github.com/openshift/openshift-ansible -b ansible-3.11

What’s next? We are still inside container.

ssh-keygen
# repeat command below for all your hosts
ssh-copy-id -i /root/.ssh/id_rsa.pub root@yourMachine
cd openshift-ansible/playbooks
ansible-playbook prerequisites.yml

Preparation task reconfigures and restarts Docker, so you will be kicked out of your Fedora if you are on master. No worries. Just repeat again all steps since ‘docker run’. Next time task will finish without closing container. Instead of Docker you may run Podman.

ansible-playbook deploy_cluster.yml

Ansible should have left your machine(s) with cluster running. Easy?

oc get pods — all-namespaces=true

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Jakub Jóźwicki
Jakub Jóźwicki

No responses yet

Write a response