OpenShift Installation Methods - Examples

1. Method I - Setup an OpenShift All-In-One

1.1. Install required packages

1
2
3
yum install ansible docker wget -y
systemctl enable docker
systemctl start docker

1.2. Disable Firewall

Or you have to open required ports.

1
2
systemctl disable firewalld
systemctl stop firewalld

1.3. Installing OpenShift CLI

1.3.1. Method 1 - Standard CentOS repositories

1
2
yum -y install centos-release-openshift-origin39
yum -y install origin-clients

1.3.2. Method 2 - Download and extract openshift origin

Create a directory for data (anywhere)

1
2
mkdir /data
cd /data

Check the latest version if you need.

1
2
3
wget "https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz"
tar -xzvf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz 
cd openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit

1.3.2.1. Add the directory you untarred the release into to your path:

1
2
3
4
5
export PATH=$PATH:/data/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/

# or

export PATH=$PATH:`pwd`

1.4. Configure the Docker daemon with an insecure registry parameter of 172.30.0.0/16

1
2
3
4
5
6
7
cat > /etc/docker/daemon.json <<DELIM
{
   "insecure-registries": [
     "172.30.0.0/16"
   ]
}
DELIM

1.4.1. Restart docker service

1
service docker restart

1.5. Initiate cluster

1
oc cluster up --base-dir="/data/clusterup" --public-hostname=<IP>
  • --base-dir=BASE_DIR : Directory on Docker host for cluster up configuration

(oc cluster up –public-hostname=35.239.51.76 –routing-suffix=35.239.51.76.xip.io) openshift.local.clusterup/openshift-controller-manager/openshift-master.kubeconfig

1.5.1. Ref:

  • https://github.com/openshift/origin/blob/release-3.11/docs/cluster_up_down.md
  • https://medium.com/@fabiojose/working-with-oc-cluster-up-a052339ea219

1.5.2. Add a user

1
2
3
4
# oc create user redhat
user.user.openshift.io/redhat created
# oc adm policy add-cluster-role-to-user cluster-admin redhat
cluster role "cluster-admin" added: "redhat"

2. Method II - Setup minishift

2.1. Setup Virtual Environment

2.2. Install minishift

or

Installation on mac

1
brew cask install minishift
  • in case issue to install export HOMEBREW_NO_ENV_FILTERING=1*

2.3. Start minishift cluster

1
2
3
4
minishift start --vm-driver virtualbox

# setup VirtualBox Permanently
minishift config set vm-driver virtualbox

Once started, access the console using url or open in browser

1
minishift console

setup oc access

1
2
3
4
$ minishift oc-env
export PATH="/home/john/.minishift/cache/oc/v1.5.0:$PATH"
# Run this command to configure your shell:
# eval $(minishift oc-env)

3. Method III - OpenShift 4 - All in One Quick Cluster

https://github.com/openshift/okd/releases

4. Method IV - OpenShift Full Cluster

5. Extras OpenSHift 4.x

https://github.com/openshift/okd

Create clouds.yaml

1
2
3
4
5
6
7
8
clouds:
  ocp4-dev:
    auth:
      auth_url: http://10.6.1.209:35357/
      project_name: ocp4-dev
      username: ocpadmin
      password: ocpadmin
    region_name: RegionOne

5.1. OpenShift 4.2 Installation

https://docs.openshift.com/container-platform/4.2/installing/installing_bare_metal/installing-bare-metal.html

5.2. OpenShift 4.1 Installation

https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html/installing/index

5.3. Baremetal Installation

https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html/installing/installing-on-bare-metal https://docs.openshift.com/container-platform/4.1/installing/installing_bare_metal/installing-bare-metal.html https://blog.openshift.com/openshift-4-bare-metal-install-quickstart/

https://blog.openshift.com/revamped-openshift-all-in-one-aio-for-labs-and-fun/

VMware https://labs.consol.de/container/platform/openshift/2020/01/31/ocp43-installation-vmware.html

https://blogs.ovirt.org/2019/01/ovirt-openshift-part-1/

6. baremetal

https://docs.openshift.com/container-platform/4.3/installing/installing_bare_metal/installing-bare-metal.html#cluster-entitlements_installing-bare-metal

comments powered by Disqus