L22 - OCP4_PowerVS
L22 - OCP4_PowerVS
Miscellaneous.
1
2021 Lab Services Hybrid Cloud Workshop – L22
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:
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.
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.
3
2021 Lab Services Hybrid Cloud Workshop – L22
4
2021 Lab Services Hybrid Cloud Workshop – L22
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.
6
2021 Lab Services Hybrid Cloud Workshop – L22
After this procedure is complete, you can proceed to the next step of image
preparation.
7
2021 Lab Services Hybrid Cloud Workshop – L22
Bastion can also be configured for high availability (HA). For HA, two
bastion nodes will get used.
One vCPU
16 GB RAM
120 GB (tier 3) storage
One vCPU
32 GB RAM
120 GB (tier 3) storage
Bastion (helper)
The bastion instance hosts the following required services for OpenShift
Container Platform:
8
2021 Lab Services Hybrid Cloud Workshop – L22
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
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
13
2021 Lab Services Hybrid Cloud Workshop – L22
14
2021 Lab Services Hybrid Cloud Workshop – L22
15
2021 Lab Services Hybrid Cloud Workshop – L22
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.
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.
17
2021 Lab Services Hybrid Cloud Workshop – L22
18
2021 Lab Services Hybrid Cloud Workshop – L22
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
• 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.
Example:
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
Example:
General section
Resources section
4. Select the resource type to generate: Deployment
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:
Example:
__ 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:
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
Example:
28
2021 Lab Services Hybrid Cloud Workshop – L22
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
Example:
Example:
# hostname
30
2021 Lab Services Hybrid Cloud Workshop – L22
Example:
# 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
Example:
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
Example:
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
Yes.
Example: In this example, the pod name changed from httpd-6d7564cf9-7g5p2 to httpd-
6d7564cf9-wn6zb.
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:
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
Example:
Example:
37
2021 Lab Services Hybrid Cloud Workshop – L22
Example:
38
2021 Lab Services Hybrid Cloud Workshop – L22
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
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
Example:
Example:
43
2021 Lab Services Hybrid Cloud Workshop – L22
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
Example:
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
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:
Example:
49
2021 Lab Services Hybrid Cloud Workshop – L22
__ 31. Select the name of the running pod to display information about the pod:
Example:
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
In this section we will add a route to balance the network traffic between the two HTTP
instances.
Example:
52
2021 Lab Services Hybrid Cloud Workshop – L22
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
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
In this section we will test the load balance network traffic between the two HTML instances.
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
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
Example:
c. In the Administrator perspective, navigate to the Pods menu. Workloads > Pods:
Example:
Example:
61
2021 Lab Services Hybrid Cloud Workshop – L22
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:
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.
64
2021 Lab Services Hybrid Cloud Workshop – L22
__ 43. Install the wget package on CentOS using the following command:
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%.
End of exercise
IBM Systems Worldwide Client Experience Centers 1 © Copyright IBM Corporation 2020
67
2021 Lab Services Hybrid Cloud Workshop – L22
Miscellaneous:
https://github.ibm.com/redstack-power/docs/wiki/NFS-Provisioner-
steps
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
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
https://lr-sellers.yourlearning.ibm.com/#/course/6319/details?ref=yl
https://yourlearning.ibm.com/activity/SMT-6465
69
2021 Lab Services Hybrid Cloud Workshop – L22
70