0% found this document useful (0 votes)
6 views

L22 - OCP4_PowerVS

The document outlines a lab workshop for installing Red Hat OpenShift Container Platform 4.x on IBM Power Systems Virtual Servers, detailing prerequisites, setup steps, and deployment topology. It includes instructions for creating an IBM Cloud account, setting up a PowerVS service, and configuring the OpenShift environment. The lab emphasizes the necessary components and configurations for a successful OpenShift deployment on Power Systems Virtual Servers.

Uploaded by

r.m.papazov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

L22 - OCP4_PowerVS

The document outlines a lab workshop for installing Red Hat OpenShift Container Platform 4.x on IBM Power Systems Virtual Servers, detailing prerequisites, setup steps, and deployment topology. It includes instructions for creating an IBM Cloud account, setting up a PowerVS service, and configuring the OpenShift environment. The lab emphasizes the necessary components and configurations for a successful OpenShift deployment on Power Systems Virtual Servers.

Uploaded by

r.m.papazov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

2021 Lab Services Hybrid Cloud Workshop – L22

Lab 22: Installing Red Hat OpenShift Container


Platform 4.x on IBM Power Systems Virtual Servers

The lab contains the following parts:

 Introduction and LAB prerequisites.

 Lab Setup in PowerVS .

 OpenShift deployment topology .

 Installing Red Hat OpenShift Container Platform 4.x on IBM


Power Systems Virtual Servers.

 LAB exercise instructions.

 Miscellaneous.

1
2021 Lab Services Hybrid Cloud Workshop – L22

Introduction and LAB prerequisites

This LAB shows you how to deploy a Red Hat® OpenShift® cluster on IBM®
Power Systems™ Virtual Servers using the user-provisioned infrastructure
(UPI) method.

A system to execute the tutorial steps. This could be your laptop or a remote
virtual machine (VM) with public internet connectivity and bash shell installed. The
system must be running one of the following (64-bit) operating systems:

o Mac OS X (Darwin) – 10.15 (Catalina and later)


o Linux® (x86_64) – RHEL8 or CentOS8 and later, Ubuntu 16.04 and later
o Microsoft® Windows® 10 (64-bit) with Cygwin, Git Bash, or Windows
Subsystem for Linux (WSL)

Lab Setup in PowerVS

2
2021 Lab Services Hybrid Cloud Workshop – L22

<Provide step-by-step instructions to the user on how to set up her/his lab environment in
PowerVS, including creating any VSIs you need or ordering services other than Direct Link (like
Vyatta). Assume only these components are in place:
1. The user has an account in PowerVS.
2. The user has a PowerVS service created (but no VSIs in PowerVS, Cloud Classic or
VPC).
3. The account has Direct Link operational.

1. Create an IBM Cloud® account.


If you don’t already have one, you need a paid IBM Cloud account to create
your Power Systems Virtual Server instance. To create an account, go
to: cloud.ibm.com
2. Create an IBM Cloud account API key.
Refer to the following documentation to create an API
key: https://cloud.ibm.com/docs/account?topic=account-userapikey
3. Create a Power Systems Virtual Server service.

After you have an active IBM Cloud account, you can create a Power Systems
Virtual Server service. To do so, perform the following steps:

1. Log in to the IBM Cloud dashboard and search for Power in the catalog.

View a larger version of the figure


2. Click Power Systems Virtual Server to provide the required details for
the service.

3
2021 Lab Services Hybrid Cloud Workshop – L22

View a larger version of the figure


3. Provide a meaningful name for your instance in the Service name field.
For example, ocp-powervs-test-1
Select an appropriate resource group. You can find more details about
resource groups at: https://cloud.ibm.com/docs/account?topic=account-
rgs

View a larger version of the figure


4. Click Create to create the service.
4. Create a private network.
It is mandatory to have a private network for your OpenShift Container Platform
cluster. To create a private network for the Power Systems Virtual Server
service instance created in the previous step, select the service, click Subnets,
and provide the required input. Sample input values are shown in the following
screen captures. Please note down the private network details like vlan-
id, location etc. You’ll need this for the next step.
Note: If you see a screen displaying CRN and GUID, then click View full
details to access the Subnet creation page.

4
2021 Lab Services Hybrid Cloud Workshop – L22

View a larger version of the figure

View a larger version of the figure

View a larger version of the figure


5. Raise a service request.

To enable the virtual instances in the service to communicate within the private
subnet, you must create a service request. Perform the following steps to raise
the service request.

5
2021 Lab Services Hybrid Cloud Workshop – L22

1. Click Support at the top of the page, scroll down to the Contact
Support section, and then click Create a case.

View a larger version of the figure


2. Select the Power Systems Virtual Server tile, then provide the details
by copying the following subject and description into the appropriate
fields on the Create a case page:
[Subject:] Enable communication between PowerVS instances on private
network
[Description:]
Please enable IP communication between PowerVS instances for the
following private network:
Name: <your-subnet-name-from-above>
Type: Private
CIDR: <your ip subnet-from-above>
VLAN ID: <your-vlan-id> (listed in your subnet details post-creation)
Location: <your-location> (listed in your subnet details post-creation)
Service Instance: <your-service-name>

6
2021 Lab Services Hybrid Cloud Workshop – L22

View a larger version of the figure


3. Click Continue to accept the agreement and then click Submit case.

This usually takes a day to get enabled.

After this procedure is complete, you can proceed to the next step of image
preparation.

7
2021 Lab Services Hybrid Cloud Workshop – L22

OpenShift deployment topology

The basic deployment of Red Hat OpenShift Container Platform consists of a


minimum of seven Power Systems Virtual Server instances:

 One bastion (helper)


 One bootstrap
 Three controllers (masters)
 Two workers

Bastion can also be configured for high availability (HA). For HA, two
bastion nodes will get used.

The minimum configuration for bastion is as follows:

 One vCPU
 16 GB RAM
 120 GB (tier 3) storage

The minimum configuration for bootstrap, controller, and worker instances


are as follows:

 One vCPU
 32 GB RAM
 120 GB (tier 3) storage

Bastion (helper)
The bastion instance hosts the following required services for OpenShift
Container Platform:

 Dynamic Host Configuration Protocol (DHCP) service for OpenShift Container


Platform nodes
 Domain Name System (DNS) service for the OpenShift Container Platform
domain
 HTTP file server to host ignition config files
 HAProxy to load-balance traffic to OpenShift Container Platform controllers and
ingress router
 Squid proxy for OpenShift Container Platform nodes to access internet

Figure 1 shows a logical view of the OpenShift topology.

8
2021 Lab Services Hybrid Cloud Workshop – L22

Figure 1. OpenShift deployment topology on Power Systems Virtual


Servers

Following are the key aspects of the deployment topology:

 All OpenShift (RHCOS) nodes are in the private network.


 Bastion uses both public and private network. It communicates with the
OpenShift nodes on the private network.
 OpenShift installation uses cluster-wide proxy that is set up on the bastion. The
cluster-wide proxy enables OpenShift nodes to access the public internet. Refer
to the following OpenShift documentation for more details on cluster-wide proxy

9
2021 Lab Services Hybrid Cloud Workshop – L22

usage: https://docs.openshift.com/container-platform/4.6/networking/enable-
cluster-wide-proxy.html
 If any OpenShift application needs internet access, then you must set
the HTTP_PROXY and HTTPS_PROXY environment variables with the value of the
cluster-wide proxy.
 Applications must use HTTPS routes if exposing traffic to the outside world. This
is because Power Systems Virtual Servers enables limited ports for external
access. Refer to the documentation at: https://cloud.ibm.com/docs/power-iaas?
topic=power-iaas-network-security for more details.
 Port 6443, which is used for OpenShift Container Platform CLI access, is blocked
in WDC04 and DAL13 data centers. You need to log in to the bastion node for
using CLI (oc) in these data centers.

10
2021 Lab Services Hybrid Cloud Workshop – L22

Installing OpenShift Container Platform on Power


Systems Virtual Server

Perform the following steps to install OpenShift Container Platform on Power


Systems Virtual Server:

1. Get the installation artifacts.

o IBM Cloud API key (refer to the instructions )


o OpenShift pull secret (download the secret)
o RHEL subscription ID and password

2. Download the installation helper script.

Open a terminal window and type the following commands:

mkdir ocp-install-dir && cd ocp-install-dir


curl -sL https://raw.githubusercontent.com/ocp-power-automation/openshift-
install-power/master/openshift-install-powervs -o openshift-install-powervs &&
chmod +x openshift-install-powervs
export PATH=$PATH:$(pwd)
ocp-install-dir is the install directory where all the install artifacts will be
kept.
Prior to install ( Please copy your pull secret to ocp-install-dir ) :

You can also copy the openshift-install-powervs helper script to a directory


in your system $PATH (for example, /usr/local/bin).

3. Start the installation.

Run the following commands to export the API key and RHEL subscription
password as environment variables:

11
2021 Lab Services Hybrid Cloud Workshop – L22

set +o history
export IBMCLOUD_API_KEY=’<YOUR_IBM_CLOUD_API_KEY>’
export RHEL_SUBS_PASSWORD=’<YOUR_RHEL_SUBSCRIPTION_PASSWORD>’
set -o history
Place the OpenShift pull secret file in the install directory and name it as pull-
secret.txt, or you can paste the content when prompted by the helper script.

Prior to install :

12
2021 Lab Services Hybrid Cloud Workshop – L22

Run the following command to start the OpenShift cluster deployment.

13
2021 Lab Services Hybrid Cloud Workshop – L22

openshift-install-powervs create -all-images

14
2021 Lab Services Hybrid Cloud Workshop – L22

$ openshift-install-powervs create -all-images

[setup_ibmcloudcli] Installing the latest version of IBM-Cloud CLI...


Attempt: 1/5
/Users/saurabh/Desktop/OpenShift/ocp-install-dir/ibmcloud version 1.4.0+4705d79-2021-02-
24T21:58:03+00:00
[setup_terraform] Installing the latest version of Terraform...
Attempt: 1/5
Terraform v0.13.6
[setup_occli] Installing the latest version of OpenShift CLI...
Attempt: 1/5
Client Version: 4.7.5
[precheck_artifacts] WARN: Cannot find artifacts directory... running setup command
[setup] Running setup command...
[setup_artifacts] Downloading code artifacts release-4.7 in ./automation
Attempt: 1/5
[setup] SUCCESS: setup command completed!
[powervs_login] Trying to login with the provided IBMCLOUD_API_KEY...
[powervs_login] Targeting 'Power Systems Virtual Server-Toronto' with Id
crn:v1:bluemix:public:power-iaas:tor01:a/63d890668cdd02588d87a0fc2423bb94:e6e7514a-6dc4-4711-
900c-9e402668c2b4::
[init_terraform] Initializing Terraform plugins and validating the code...
[apply] Running terraform apply... please wait
1) Power Systems Virtual Server-SaurabhSharmaLONDON04
2) frankfurt virtual server
3) Power Systems Virtual Server-dallas12
4) Power Systems Virtual Server-Toronto
5) Power Systems Virtual Server-Tokyo
6) Power Systems Virtual Server-test-sao poalo
7) Power Systems Virtual Server-Montreal
#? 4
- You have answered: Power Systems Virtual Server-Toronto
Targeting service
crn:v1:bluemix:public:power-iaas:tor01:a/63d890668cdd02588d87a0fc2423bb94:e6e7514a-6dc4-4711-
900c-9e402668c2b4::...
[variables] Gathering information from the selected Service Instance... Please wait
[question] > Select the RHEL image to use for bastion node:
1) 7100-05-05 6) IBMi-73-07-001 11) rhcos-46-pra
2) 7100-05-07 7) IBMi-74-01-001 12) rhcos-47
3) 7200-04-01 8) Linux-CentOS-8-3 13) rhcos461ppc64le2

15
2021 Lab Services Hybrid Cloud Workshop – L22

4) 7200-05-01 9) CentOS83-12142020 14) rhel-83-11242020


5) IBMi-72-09-003 10) CoreOS46 15) rhel-83-pra
#? 15
- You have answered: rhel-83-pra
[question] > Select the RHCOS image to use for cluster nodes:
1) 7100-05-05 6) IBMi-73-07-001 11) rhcos-46-pra
2) 7100-05-07 7) IBMi-74-01-001 12) rhcos-47
3) 7200-04-01 8) Linux-CentOS-8-3 13) rhcos461ppc64le2
4) 7200-05-01 9) CentOS83-12142020 14) rhel-83-11242020
5) IBMi-72-09-003 10) CoreOS46 15) rhel-83-pra
#? 12
- You have answered: rhcos-47
[question] > Select the private network to use:
1) ocp-subnet
#? 1
- You have answered: ocp-subnet
[question] > Select the OCP version to use:
1) stable-4.7 5) 4.7.6 9) 4.7.2 13) 4.7.0-rc.2
2) latest-4.7 6) 4.7.5 10) 4.7.1 14) 4.7.0-rc.1
3) fast-4.7 7) 4.7.4 11) 4.7.0
4) candidate-4.7 8) 4.7.3 12) 4.7.0-rc.3
#? 1
- You have answered: stable-4.7
[question] > Enter a short name to identify the cluster (test-ocp)
? test-ocp
- You have answered: labs-ocp
[question] > Enter a domain name for the cluster (ibm.com)
?
- You have answered: nip.io
[question] > Do you want to configure High Availability for bastion nodes?
1) yes
2) no
#? 2
- You have answered: no
[question] > Do you need NFS storage to be configured?
1) yes
2) no
#? 1
- You have answered: yes
[question] > Enter the NFS volume size(GB) (300)
? 300
- You have answered: 300
[question] > Do you want to use the default configuration for all the cluster nodes?
1) yes
2) no
#? 1
- You have answered: yes
[question] > Enter RHEL subscription username for bastion nodes
? sharma3ebb
- You have answered: sharma3ebb
[variables] WARN: Using the subscription password from environment variables
[question] > Found SSH key pair in /Users/saurabh/.ssh/ do you want to use them? (yes)
? yes
- You have answered: yes
[variables] SUCCESS: variables command completed!
[powervs_login] Trying to login with the provided IBMCLOUD_API_KEY...
[powervs_login] Targeting 'Power Systems Virtual Server-Toronto' with Id
crn:v1:bluemix:public:power-iaas:tor01:a/63d890668cdd02588d87a0fc2423bb94:e6e7514a-6dc4-4711-
900c-9e402668c2b4::

[init_terraform] Initializing Terraform plugins and validating the code...

Now wait for the installation to complete. It may take around 60 min to
complete the provisioning.

16
2021 Lab Services Hybrid Cloud Workshop – L22

After successful installation, the cluster details will be displayed as shown in the
following sample output.

[apply] Running terraform apply... please wait


Attempt: 1/5
[retry_terraform] Deleting the bootstrap node... please wait(5%)
Attempt: 1/5
[retry_terraform] Completed running the terraform command.
Login to bastion: ssh -i /Users/saurabh/.ssh/id_rsa [email protected] and start using the 'oc'
command.
To access the cluster on local system when using 'oc' run: export
KUBECONFIG=/Users/saurabh/Desktop/OpenShift/ocp-install-dir/automation/kubeconfig
NOTE: 'oc' on local system will not work for WDC04 and DAL13 DC. Login to bastion system to use
'oc'
Access the OpenShift web-console here: https://console-openshift-console.apps.labs-ocp-
be73.169.48.19.53.nip.io
Login to the console with user: kubeadmin and password: xr9uk-UL7fU-R6RSj-KRxTz

[apply] SUCCESS: Congratulations! create command completed

from the install directory:

openshift-install-powervs access-info
In case of any errors, run the openshift-install-powervs create command
again. Refer to known issues to get more details about the potential issues and
workarounds.
You can also get the Terraform console logs from the logs directory for each
run.

Terraform script will deploy necessary resources and VM’s :

17
2021 Lab Services Hybrid Cloud Workshop – L22

18
2021 Lab Services Hybrid Cloud Workshop – L22

LAB Exercise Instructions

Lab: OpenShift 4.X Container Platform on Power

Introduction:
Estimated time

01:30

Overview

In this exercise, you will become familiar with basic functionalities of Red Hat OpenShift
Container Platform for Power V4.X

Objectives

At the end of this exercise, you should be able to:

• Utilize the Red Hat OpenShift Container Platform web console to perform basic operations
• Perform a sample application deployment from the Red Hat OpenShift Container Platform web
console

Requirements

• This workbook.
• Access to a POWER8 or POWER9 processor-based managed system configured with Red Hat
Enterprise Linux 8.3 and OpenShift Container Platform for Power V4.X.
• Account credentials.

Lab Environment

19
2021 Lab Services Hybrid Cloud Workshop – L22

Section 1. Deploy HTTP server via Red Hat OpenShift Container Platform
web console

In this section you will deploy a HTTP server using an image using the Developer perspective of
the web
console.

__ 1. Navigate to the Developer perspective using the perspective switcher. There is a pull-down
arrow next to the user role.

20
2021 Lab Services Hybrid Cloud Workshop – L22

__ 2. After toggling Developer, your browser will load to the Topology tab.
Make sure that Project has been set to the default workspace. You can do so by either clicking
the drop-down arrow beside Project: All Projects and selecting default, or by clicking
(PR)default from the list of Topologies. Refer to the following screenshots for help.

__ 3. Deploy an Apache HTTP Server application.

a. In the Developer perspective, select the +Add menu item:

Example:

b. Select the Container Image tile:

21
2021 Lab Services Hybrid Cloud Workshop – L22

Example:

c. From the Deploy Image dialog box, configure the deployment with the following settings:
1. Image name from external registry
2. Image Name: httpd
3. Click the search icon.

Example:

change

22
2021 Lab Services Hybrid Cloud Workshop – L22

d. The following information will appear:

Example:

e. Complete the configuration of the deployment with the following settings:

General section

1. Application Name: httpd-app


2. Name: httpd

Resources section
4. Select the resource type to generate: Deployment

Advanced Options section


5. Select the check box: Create a route to the application

6. To complete the deployment, click the Create button.

Example:

23
2021 Lab Services Hybrid Cloud Workshop – L22

f. The deployed application appears in the Topology view of the Developer perspective:
Example:

24
2021 Lab Services Hybrid Cloud Workshop – L22

g. Select the Open URL widget on the edge of the deployment icon, this will open the default
route created during the deployment within a new tab on your web browser.

Example:

h. Verify that the newly displayed URL states “It works!”.

Example:

Section 2. Check the status of the deployment


In this section you will check the status of the HTTP server deployment and gather information
from the Developer perspective view.

__ 4. From the web console, navigate to the Developer perspective view, the Topology menu,
and select the center of the deployment icon to display the side bar containing information about
the deployment.

25
2021 Lab Services Hybrid Cloud Workshop – L22

Example:

__ 5. Navigate to the Resources tab on the deployment side bar.

Example:

26
2021 Lab Services Hybrid Cloud Workshop – L22

__ 6. From the displayed list of pods, how many containers are in the Running Status?
Note: There should be one running pod.

__ 7. Select the name of the running pod to display information about the pod:

Example:

27
2021 Lab Services Hybrid Cloud Workshop – L22

__ 8. The following information will appear:

Example:

28
2021 Lab Services Hybrid Cloud Workshop – L22

__ 9. From the same Overview tab, collect the following information:

IP address of the Pod: ________________


Restart Policy: _________________

Example:

Information: A pod restart policy determines how OpenShift Container Platform responds when
containers in that pod exit. The policy applies to all containers in that pod. A restart policy of
Always is the default value. OpenShift Container Platform will try restarting a successfully
exited container on the pod continuously, with an exponential back-off delay (10s, 20s, 40s) until
the pod is restarted.

29
2021 Lab Services Hybrid Cloud Workshop – L22

__ 10. Select the Terminal tab:

Example:

__ 11. The following information will appear:

Example:

__ 12. Issue the following commands in the terminal window:

a. Identify the hostname of the running container:

# hostname

30
2021 Lab Services Hybrid Cloud Workshop – L22

Example:

b. Identify the IP address of the running container:

# hostname -i

Example ( Use this sample output to complete course - Cloud Experts Part 3b -
OpenShift Container Platform on POWER ):

31
2021 Lab Services Hybrid Cloud Workshop – L22

c. Issue the exit command to close the terminal window:

Example:

Section 3. Test the resiliency of the deployment

In the previous section, you discovered that the pod restart policy for your deployment was set to
Always Restart. In this section we will test the resiliency of the deployment.

32
2021 Lab Services Hybrid Cloud Workshop – L22

__ 13. To simulate a pod failure, terminate the pod.

a. From the Actions drop down menu, select Delete:

Example:

b. Confirm the deletion of the pod. Click Delete:

Example:

Information: The pod will be terminated immediately. The pod will go through a process of
restarting.

33
2021 Lab Services Hybrid Cloud Workshop – L22

__ 14. Did the pod name change?

Yes.

Example: In this example, the pod name changed from httpd-6d7564cf9-7g5p2 to httpd-
6d7564cf9-wn6zb.

Section 4. Scaling the deployment

In this section we will scale the deployment up to two pods and then back down to one from the
Developer perspective view.

34
2021 Lab Services Hybrid Cloud Workshop – L22

__ 15. Select the center of the deployment icon to display the side bar containing information
about the deployment:

Example:

__ 16. Navigate to the Resources tab on the deployment side bar:

Example:

35
2021 Lab Services Hybrid Cloud Workshop – L22

__ 17. Scale up the deployment from one pod to two, by selecting the Edit Count from the
Actions drop down menu:

Example:

__ 18. Increase the deployment count from 1 to 2 by clicking the + button, then click Save:

Example:

__ 19. OpenShift Container Platform will now start an additional pod, this action may take a
moment.

36
2021 Lab Services Hybrid Cloud Workshop – L22

__ 20. Verify the second pod has started:

Example:

__ 21. Navigate to the Administrator perspective using the perspective switcher:

Example:

37
2021 Lab Services Hybrid Cloud Workshop – L22

__ 22. Navigate to the Deployment menu. Workloads > Deployment:

Example:

38
2021 Lab Services Hybrid Cloud Workshop – L22

__ 23. Select your httpd deployment from the table.

Example:

39
2021 Lab Services Hybrid Cloud Workshop – L22

__ 24. Scale down the pods from 2 to 1, by selecting the down arrow next to the pod count:

Example:

40
2021 Lab Services Hybrid Cloud Workshop – L22

__ 25. OpenShift Container Platform will now terminate one of the pods, this action may take a
moment:

Example:

41
2021 Lab Services Hybrid Cloud Workshop – L22

__ 26. Verify that only one pod is running:

Example:

Question: Did you see the difference between deleting a Pod and scaling down a Pod? When
you delete a Pod, you terminate the service removing it from any additional network access. But,
when you scale it down, you only decrease the available Pod replicas of the service.

42
2021 Lab Services Hybrid Cloud Workshop – L22

Section 5. Deploy a second HTTP server instance

In this section we will deploy another HTTP application.

__ 27. Navigate to the Developer perspective using the perspective switcher:

Example:

__ 28. Deploy the second Apache HTTP Server application.

a. In the Developer perspective, select the +Add menu item:

Example:

43
2021 Lab Services Hybrid Cloud Workshop – L22

b. Select the Container Image tile:

Example:

44
2021 Lab Services Hybrid Cloud Workshop – L22

c. From the Deploy Image dialog box, configure the deployment with the following settings:
1. Image name from external registry
2. Image Name: httpd
3. Click the search icon.

Example:

45
2021 Lab Services Hybrid Cloud Workshop – L22

d. The following information will appear:

Example:

e. Complete the configuration of the deployment with the following settings:

General section
1. Application: Create Application
2. Application Name: httpd-app2
3. Name: httpd2

Resources section
4. Select the resource type to generate: Deployment

46
2021 Lab Services Hybrid Cloud Workshop – L22

Advanced Options section

5. De-Select the check box: Create a route to the application

6. To complete the deployment, click the Create button.

Example:

47
2021 Lab Services Hybrid Cloud Workshop – L22

f. The deployed application appears in the Topology view of the Developer perspective:

Example:

48
2021 Lab Services Hybrid Cloud Workshop – L22

__ 29. Select the center of the deployment icon for the httpd-app2 to display the side bar
containing information about the deployment:

Example:

__ 30. Navigate to the Resources tab on the deployment side bar:

Example:

49
2021 Lab Services Hybrid Cloud Workshop – L22

__ 31. Select the name of the running pod to display information about the pod:

Example:

__ 32. Select the Terminal tab:

Example:

50
2021 Lab Services Hybrid Cloud Workshop – L22

__ 33. Issue the following command to change the index.html file with the text.
HTML2_works_too!, and close the terminal window with the exit command:

# cp /usr/local/apache2/htdocs/index.html /tmp/index.html
# echo HTML2_works_too! > /usr/local/apache2/htdocs/index.html
# exit

Example:

51
2021 Lab Services Hybrid Cloud Workshop – L22

Section 6. Create a route to balance the network traffic

In this section we will add a route to balance the network traffic between the two HTTP
instances.

__ 34. Navigate to the Administrator perspective using the perspective switcher:

Example:

52
2021 Lab Services Hybrid Cloud Workshop – L22

__ 35. Navigate to the Routes menu. Networking > Routes:

Example:

53
2021 Lab Services Hybrid Cloud Workshop – L22

__ 36. Select the Create Route button. Create the route with the following properties:

1. Name: demo-route
2. Service: httpd
• Click on + Add Alternate Service
3. Weight: 50
4. Alternative Service Target: http2
5. Alternative Service Weight: 50
6. Target Port: 80->80
7. Click the Create button to complete the operation.

Example:

54
2021 Lab Services Hybrid Cloud Workshop – L22

__ 37. The new route will be displayed.

Example:

55
2021 Lab Services Hybrid Cloud Workshop – L22

__ 38. Obtain the Location (URL) of the demo-route and save it.

Location: _________________
Example:

56
2021 Lab Services Hybrid Cloud Workshop – L22

Section 7. Test load balance the network traffic

In this section we will test the load balance network traffic between the two HTML instances.

__ 39. Change the index.html file of the first HTTP server.

a. Navigate to the Developer perspective view and select the Topology menu:

Example:

57
2021 Lab Services Hybrid Cloud Workshop – L22

b. Select the center of the deployment icon for http-app to display the side bar containing
information about the deployment:

Example:

b. Navigate to the Resources tab on the deployment side bar and select the name of the
running pod to display information about the pod:

Example:

58
2021 Lab Services Hybrid Cloud Workshop – L22

c. Select the Terminal tab and issue the following commands:

Example:

59
2021 Lab Services Hybrid Cloud Workshop – L22

e. Issue the following command to change the index.html file with the text HTML1_works, and
close the terminal window with the exit command:

# cp /usr/local/apache2/htdocs/index.html /tmp/index.html
# echo HTML1_works! > /usr/local/apache2/htdocs/index.html
# exit

Example:

60
2021 Lab Services Hybrid Cloud Workshop – L22

__ 40. Create a CentOS pod:

a. Navigate to the Administrator perspective using the perspective switcher:

Example:

c. In the Administrator perspective, navigate to the Pods menu. Workloads > Pods:

Example:

c. Select the Create Pod button:

Example:

61
2021 Lab Services Hybrid Cloud Workshop – L22

d. Create the pod manually using the following YAML file:

kind: Pod
apiVersion: v1
metadata:
name: centos-pod # Pod name
spec:
containers:
- name: centos # Container name
image: centos:latest
command: [ "/bin/sh", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
restartPolicy: "Never"

WARNING: Use TABS to create the whitespace in front of lines 4, 6, 7, 8, 9, and 10. YAML
uses a fixed indentation scheme to represent relationships between data layers. Lines 8, 9, and 10
need 2 TABS.

62
2021 Lab Services Hybrid Cloud Workshop – L22

Example:

e. Wait until you see the centos-pod in Running state:

Example:

63
2021 Lab Services Hybrid Cloud Workshop – L22

__ 41. Take a quick look around the Pod Overview under the Overview tab. You can see usage
statistics about the pod that you have created. These statistics include CPU, memory, and storage
consumption.

__ 42. Select the Terminal tab to open the terminal window:


Example:

64
2021 Lab Services Hybrid Cloud Workshop – L22

__ 43. Install the wget package on CentOS using the following command:

# yum -y install wget

Example:

65
2021 Lab Services Hybrid Cloud Workshop – L22

__ 44. Execute the following script to test out the load balancing.

for i in 1 2 3 4 5 6 7 8 9 10 11 12
do
wget -q http://[URL_of_the_demo-route] -O index.test
grep works index.test
done

Example ( Use this sample output to complete course - Cloud Experts Part 3b -
OpenShift Container Platform on POWER ):

66
2021 Lab Services Hybrid Cloud Workshop – L22

Note: From the command output you can see that the route alternated between HTML1
and HTML2 servers at a rate of 50%.

__ 45. This concludes the lab exercise.

End of exercise

Exercise review and wrap-up


During this lab exercise, students became familiar with basic functionalities of Red Hat
OpenShift Container Platform for Power V4.7.

IBM Systems Worldwide Client Experience Centers 1 © Copyright IBM Corporation 2020

67
2021 Lab Services Hybrid Cloud Workshop – L22

Miscellaneous:

I. Steps to configure NFS , post OCP install :

https://github.ibm.com/redstack-power/docs/wiki/NFS-Provisioner-
steps

II. Developer WIKI :

https://developer.ibm.com/components/ibm-power/tutorials/install-
ocp-on-power-vs/

III. To IBM Power Virtual Server Setup and OVA image creation :

a. https://developer.ibm.com/tutorials/setting-up-powervs-for-ocp/

b. https://developer.ibm.com/tutorials/preparing-ova-for-openshift-
on-cloud/

68
2021 Lab Services Hybrid Cloud Workshop – L22

IV. To import pre existing RHEL image and RHCOS to COS :

Below are steps to import RHEL and RCOS images available:

a. https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-
importing-boot-image

b. https://github.ibm.com/redstack-power/docs/wiki/PowerVS-
latest-Images

V. Cloud Experts Part 3a - IBM POWER Systems Virtual Server

https://lr-sellers.yourlearning.ibm.com/#/course/6319/details?ref=yl

VI. Cloud Experts Part 3b - OpenShift Container Platform on


POWER ( Complete below training – Course material for LABs
has been used from below training ):

https://yourlearning.ibm.com/activity/SMT-6465

69
2021 Lab Services Hybrid Cloud Workshop – L22

70

You might also like