marhatha / OCP4-Workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DO NOT USE THIS PROJECT YET

ℹ️
THIS PROJECT IS IN ALPHA. DOCUMENTATION WILL BE UPDATED AFTER BLUEPRINT IS WORKING

DO NOT USE THIS PROJECT YET

Usage

ℹ️
This project and playbooks strive to mimic the hands-on UPI approach to deploying a Openshift cluster. Shell commands are often used in preference to otherwise fanstastic ansible modules in order to preserve the steps outlined in the actual installation guide.

Default architecture is 7 systems: * bastion - utility vm * bootstrap - ocp installation provisioner * masters-{0,1,2} * workers-{0,1}

At the completion of the install, the bootstrap node has served it’s purpose and can be safely shutdown (or deleted).

1. Utility-Host-Only Services

Deploying Openshift in an automated way depends on typical network services like dhcp-server, dns, http, etc…​ One method to deploying OCP is to set up a utility server to run these services. This simplfies configuration and control of the deployment.

This section describes the steps to configuring the utility server using RHEL 8.

1.1. RHEL 8 @Base Installation

Starting with a simple deployment of RHEL 8

  • Configure Repos (subscription-manager register)

  • Install ansible-2.9

  • Install git

yum install git ansible

1.2. Clone git Repo

As the user 'root', change to you home directory and clone the source.

cd ~

git clone http://github.com/xtophd/OCP4-Workshop

1.3. Create Config Files

You can use a sample-config to start this process. Please note that in this example we are using a NAT example.

cd ./OCP4-Workshop/config

cp ../sample-configs/utility-host-only/master-config.yml .

1.4. Edit Config Files

⚠️
You must edit the config files for your deployment. There is no magic installation.

Just like the name implies 'master-config.yml' is the main configuration file. Most parameters should be straight forward, but in particular you need to:

  • fix hostnames, mac addresses & ip addresses

  • set or comment out h_mBoxDev accordingly

1.5. Place the Pull Secret

The pull-secret needs to be placed in the config directory. This is a text file you hopefully downloaded from cloud.redhat.com.

cp <PULL_SECRET> ./OCP4-Workshop/config/pull-secret.txt

1.6. Run the Playbooks

Now it’s time to run the playbooks which configure and enable the services in preparation for the Openshift cluster deployment.

cd ./OCP4-Workshop/
bash prepare-ocp4-workshop.sh all

1.7. Boot the Bootstrap

1.8. Boot the Masters

1.9. Boot the Workers

1.10. Extra Info

Artifacts from the build will be in /root/ocp-<clustername>

Authtority files will be in /root/ocp-<clustername>/auth

2. LIBVIRT/KVM Host with OCP as VMs

Systems are deployed in a NAT’d internal network. You can easily change this to a bridged network.

NAT is easy because: dhcp, pxe don’t conflict with public network it’s a real cloud, ie: you get ingress through the haproxy loadbalancer

The bastion host is built from DVD and post-configured with ansible plays to enable: dns dhcp pxe matchbox nfs for persistent storage (not supported in PROD, but works for POC) openshift install/ignition generation

Lastly, these are default configurations on the virt host but can be changed:

vm images will go into /home/virt-images iso images will got into /home/iso network is NAT by default with 192.168.123.xxx and ocp.example.com as internal domain.

Virt host should be loaded with either RHEL 7.7+ or RHEL 8.1+

2.1. Prequisits

  • RHEL 7.7+ or 8.0+

  • installed packages: git, ansible 2.9

  • configured (accessible) repos for base, optional/appstream and ansible

  • log on to cloud.redhat.com and get your pull-secret.txt

2.2. Preperation (libvirt)

On your virt host:

  • subscription manager register and attach host

  • mkdir -p /home/iso

  • mkdir -p /home/virt-images

  • cd /home/iso

  • <PLACE RHEL ISO’s HERE>: rhel-8.1-x86_64-dvd.iso rhel-8.2-x86_64-dvd.iso

Still on virt host:

  • cd /usr/local/src

  • git clone http://github.com/xtophd/OCP4-Workshop --recurse-submodules

  • cd /usr/local/src/OCP4-Workshop

  • cd config

  • ln -s ../sample-configs/libvirt-nat/* .

  • <PLACE PULL_SECRET HERE>: pull-secret.txt

Once again, on virt host:

  • cd /usr/local/src/OCP4-Workshop

  • export HTTPPROXY if needed

  • bash prepare-kvm-host.sh all

If all goes well, should just work and about 30 minutes later you have an operational openshift cluster

2.3. Download

Currently working on the 'wsdeployer' branch. At this time I am not going to differentiate a workshop installation without the KVM install/config. It’s all or nothing

git clone http://github.com/xtophd/OCP4-Workshop --recurse-submodules -b wsdeployer

2.4. Config

Fetch the openshift pull secret from Red Hat Create your configs. Here I’m using the 'nat' network configs

cd ./OCP4-Workshop/config
cp <PULL_SECRET> ./pull_secret.txt
ln -s ..p/sample-configs/libvirt-nat/* ./OCP4-Workshop/config

3. MORE COMING SOON…​

Master document for this branch can be found here:

About

License:GNU General Public License v3.0


Languages

Language:Shell 64.0%Language:PHP 31.8%Language:Dockerfile 3.6%Language:HTML 0.7%