Disconnected Install of OpenShift Origin (Single VM)

This article explains the technique for installing OpenShift Origin (open source) v3.6.1 on a single-VM in disconnected mode (i.e. no internet proxy).

Ref: The disconnected install of OpenShift Container Platform (enterprise) is documented here, which was a great help for finding this workaround.

Environment Setup

Linux VM – CentOS 7.x Minimal
– SELINUX Disabled
– Firewall Disabled

Export docker images & oc client on a DMZ host

OPENSHIFT_REL=v3.6.1
OPENSHIFT_BLD=008f2d5

# fetch openshift-origin images
echo \
openshift/origin:${OPENSHIFT_REL} \
openshift/origin-deployer:${OPENSHIFT_REL} \
openshift/origin-docker-registry:${OPENSHIFT_REL} \
openshift/origin-haproxy-router:${OPENSHIFT_REL} \
openshift/origin-pod:${OPENSHIFT_REL} \
openshift/origin-sti-builder:${OPENSHIFT_REL} \
openshift/origin-docker-builder:${OPENSHIFT_REL} \
| xargs -n 1 docker pull

# export images
echo \
openshift/origin:${OPENSHIFT_REL} \
openshift/origin-deployer:${OPENSHIFT_REL} \
openshift/origin-docker-registry:${OPENSHIFT_REL} \
openshift/origin-haproxy-router:${OPENSHIFT_REL} \
openshift/origin-pod:${OPENSHIFT_REL} \
openshift/origin-sti-builder:${OPENSHIFT_REL} \
openshift/origin-docker-builder:${OPENSHIFT_REL} \
| xargs docker save -o openshift-origin-${OPENSHIFT_REL}-images.tar

chmod 644 openshift-origin-${OPENSHIFT_REL}-images.tar

curl -sfLOk https://github.com/openshift/origin/releases/download/${OPENSHIFT_REL}/openshift-origin-server-${OPENSHIFT_REL}-${OPENSHIFT_BLD}-linux-64bit.tar.gz

# verify the dump 
ls -hl openshift-origin-*

Prep target host

sudo yum install -y epel-release
sudo yum install -y git jq
sudo yum install -y docker 

sudo tee -a /etc/docker/daemon.json << '__EOF__'
{
  "insecure-registries" : ["172.30.0.0/16"]
}
__EOF__

sudo systemctl restart docker
sudo systemctl enable docker

Import docker images on target host

from previously exported tarball

OPENSHIFT_REL=v3.6.1
# verify - it should be ~1.9GB
ls -hl openshift-origin-${OPENSHIFT_REL}-images.tar
# import images
docker load --input openshift-origin-${OPENSHIFT_REL}-images.tar

Set environments

export OPENSHIFT=/opt/openshift

Unpack binaries

from previously downloaded tarball

sudo mkdir -p ${OPENSHIFT}
sudo chown $(id -u).$(id -g) ${OPENSHIFT}

mkdir -p ${OPENSHIFT}/bin
tar -zxvf ~/osv3-single/openshift-origin-server-*.tar.gz --strip-components 1 -C ${OPENSHIFT}/bin

mkdir ~/bin/
ln -s ${OPENSHIFT}/bin/oc ~/bin/
ln -s ${OPENSHIFT}/bin/oadm ~/bin/

Generate config

mkdir -p ${OPENSHIFT}/{data,config,volumes,pv}

Launch server

oc cluster up \
--host-data-dir=${OPENSHIFT}/data \
--host-config-dir=${OPENSHIFT}/config --use-existing-config \
--host-volumes-dir=${OPENSHIFT}/volumes \
--host-pv-dir=${OPENSHIFT}/pv \
--public-hostname=$(hostname -f)


Browse to URL: https://vm_ip_address:8443

Create admin user

oc login -u system:admin

oc delete user developer
oc delete project myproject

TODO: get imagestreams, build containers

Cheers,