🚫 PRODEVANS CONFIDENTIAL – Do Not Copy or Share 🚫
Skip to main content

Openshift Connected Cluster Deployment & Nested Virtualization Setup

Bastion Configuration:

1. DNS Configuration

1.1 Install bind

yum install bind bind-utils -y

1.2 Edit the named.conf

image.png

image.png

1.3 Create and edit forward.zone

image.png

1.4 Create and edit forward.zone

image.png

1.5 Change the ownership of forward and reverse zone files.

chown root:named /var/named/forward.zone

chown root:named /var/named/reverse.zone

image.png

1.6 Check namedconf, named zone.

named-checkconf -z /etc/named.conf

image.png

named-checkzone forward /var/named/forward.zone

image.png

named-checkzone forward /var/named/reverse.zone

image.png

1.7 Start, enable and check the named service.

systemctl start named

systemctl enable named

systemctl status named

1.8 Check the resolving.

image.png

image.png

2. haproxy configuration

2.1 Install haproxy

image.png

2.2 Edit haproxy configuration

image.png

image.png

2.3 Stop the firewalld service.

image.png

2.4 Stop the selinux service.

image.png

2.5 Start the haproxy service.

systemctl start haproxy

systemctl enable haproxy

systemctl status haproxy

3. Create the directory and download the mirror packages from

https://mirror.openshift.com/pub/openshift-v4/clients/ocp/

3.1 Download oc-mirror, openshift-client-linux and openshift-install-linux.

mkdir ocp

cd ocp/

3.2 Untar the files in the ocp directory

image.png

image.png

4. Copy the pull secret file from

https://console.redhat.com/openshift/downloads

5. Generate sshKey

ssh-keygen

image.png

image.png

6. Create a ignition directory and create install-config.yaml file.

mkdir ignition

cd ignition/

vi install-config.yaml

image.png

image.png

6.1 Create manifests in the ignition directory.

[root@prodevans ignition]# openshift-install create manifests

INFO Consuming Install Config from target directory

WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings

INFO Manifests created in: manifests and openshift

6.2 Create ignition in the ignition directory.

[root@prodevans ignition]# openshift-install create ignition-configs

INFO Consuming Common Manifests from target directory

INFO Consuming Master Machines from target directory

INFO Consuming Openshift Manifests from target directory

INFO Consuming OpenShift Install (Manifests) from target directory

INFO Consuming Worker Machines from target directory

INFO Ignition-Configs created in: . and auth

image.png

7. Install httpd service and change the port number.

7.1 Installing httpd service

image.png

7.2 Change the port number in the httpd configuration

image.png

image.png

Change the Listen port 80 to 8080.

8. Copy all the .ign files from ignition directory to /var/www/html/

cp ignition/*.ign /var/www/html/

ll /var/www/html

chmod 655 /var/www/html/*.ign

ll /var/www/html

image.png

8.1 Enable, start and check the status of httpd service.

systemctl start httpd

systemctl enable httpd

systemctl status httpd

image.png

Now the Bastion machine setup is completed.


Bootstrap Configuration

Create Bootstrap VM and become the root user then configure the network.

1. Then install the coreos.

coreos-installer install /dev/sda --ignition-url=http://192.168.96.231:8080/bootstrap.ign --insecure-ignition -copy-network --insecure

2. Reboot the machine.

reboot

3. After successful reboot, ssh into bootstrap using bastion machine.

ssh core@bootstrap

It will show journalctl command. Run that command to make sure bootstrap is running fine.


Configure customize setting for master & opting nested virtualization.

Allocate CPU :32

Enable Hardware Virtualization Expose hardware-assisted virtualization to the guest OS

image.png

Allocate memory 32 GB and storage 150GB Thin Provisioning

image.png

Add the addional disk with thick provisioning

image.png




Master & Worker Configuration

After creating the Master VM’s with the configure the network.

1. Then install the coreos.

coreos-installer install /dev/sda --ignition-url=http://192.168.96.231:8080/master.ign --insecure-ignition -copy-network --insecure

2. After the coreos is installed. reboot the machine.

Check for Certificates, nodes and cluster operators in the bastion machine.

Export the kubeconfig in the bastion machine.

export KUBECONFIG=ignition/auth/kubeconfig

Check:

1. oc get csr

2. oc get no

3. oc get co

image.png




ODF Configuration

Go to Ecosystem → Software Catalog→ search Local Storage

Local Storage Operator is used to discover and make local disks on cluster nodes available as Kubernetes storage.

image.png


Click Local Storage and Install

image.png



To verify Local Storage Operator Installation,

image.png


Installing OpenShift Data Foundation Operator:

ODF is used to create distributed, highly available storage inside OpenShift.

Go to Ecosystem→ Software Catalog→ search OpenShift Data Foundation

image.png


Click OpenShift Data Foundation Operator and click install.

image.png


Select Update Channel, Version, Name Space and Update Approval.

image.png

image.png


To Create a StorageSystem:

Click Create StorageSystem.

image.png

Select Full deployment , select Create a new StorageClass using local storage devices and click Next.

image.png


Enter LocalVolumeSet name and click Next.

image.png


Click “Yes” to create a new LocalVolumeSet.

image.png

Click Next

image.png


Click Network at Default(OVN).

image.png


Review the configuration and click create storage system.

image.png


After Click CreateStorage System necessary pods will be created under openshift-storage name space.


See the storage system creation status in GUI.

To verify storage system status is “Ready” state.

image.png

To see the Storage System status in the GUI console.

image.png




Openshift Virtualization Configuration

It is used to run Virtual Machines (VMs) inside an OpenShift cluster along with containers.

Installing OpenShift Virtualization Operator:

Go to Ecosystem→ Software Catalog→ search Openshift Virtualization.

image.png


image.png

Create HyperConverged.

image.png


image.png


NMState Operator Configuration

This operator is used to configure and manage node-level networking in OpenShift in a declarative way.

It manages:

1. Interfaces

2. Bridges

3. VLANs

4. Bonds

5. IP addresses

6. Routes

Installing NMState Operator:

Go to Ecosystem → Software Catalog→ search Kubernetes NMState Operator

image.png


image.png


image.png

Create NMState with default Form view.

image.png


image.png

Check the nmstate is created.

image.png

Then create the NodeNetworkConfigurationPolicy, OCPV need real network. so nncp is used to create linux bridge. Attach physical NIC to that bridge. VMs connect to bridge.

image.png

image.png

Here we have created 3 individual nncp using the node selector.

image.png

image.png


Network Attachment Definitions Configuration

We are creating multiple NAD networks options for VMs/pods.

image.png

NAD:

default NAD is for internal pod communication and cluster traffic.

vm-network NAD gets IP from DHCP. It auto-assign the IP to the machine.

vm-network1 NAD uses the ip from the same bridge assigns IP from the custom range. It is an controlled IP allocation.

image.png image.png image.png


Migration Toolkit for Virtualization Operator Configuration

This operator is used to migrate virtual machines from other platforms into OpenShift Virtualization.

Go to Ecosystem → Software Catalog→ search Migration Toolkit for Virtualization Operator

image.png


image.png

image.png

Create forklift-controller, it is the brain of the migration process. It controls, tracks, and manages the entire VM migration workflow.

image.png

image.png

Migration Toolkit for Containers Operator Configuration

This operator is used to migrate containerized applications (Kubernetes/OpenShift workloads) from one cluster to another.

Go to Ecosystem → Software Catalog→ search Migration Toolkit for Containers Operator

image.png


image.png


image.png

Create Migration Controller which sets up and runs the migration engine inside the cluster.

image.png

image.png

Create the MigCluster

It represents a Kubernetes/OpenShift cluster source or destination that participates in migration

image.png

image.png

Configuring htpasswd identity provider.

1. Create an HTPasswd file by installing the htpasswd utility by installing the httpd-tools package:

yum install httpd-tools

2. Create or update an users.htpasswd file with a user name and hashed password:

htpasswd -c -B -b </path/to/users.htpasswd> <user_name> <password>

3. Create the HTPasswd Secret with the previously created users.htpasswd file: