Navigate the OpenShift web console to identify CPU-consuming workloads.
Troubleshoot and fix a failed MySQL pod.
Manually scale an application.
Configure health probes.
Outcomes
You should be able to troubleshoot malfunctioning workloads, configure deployments, and scale applications.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that all resources are available for this exercise.
The command also creates the compreview-scale project and deploys some applications in that project.
The command creates the /home/student/DO180/labs/compreview-scale/resources.txt file.
The resources.txt file contains the URLs of your OpenShift cluster and the name of the images that you use during the exercise.
You can use the file to copy and paste these URLs and image names.
[student@workstation ~]$ lab start compreview-scale
Specifications
The API URL of your OpenShift cluster is https://api.ocp4.example.com:6443, and the oc command is already installed on your workstation machine.
The URL of the OpenShift web console is https://console-openshift-console.apps.ocp4.example.com. When you access the web console, select as the authentication mechanism.
Log in to the OpenShift cluster as the developer user with the developer password.
The password for the admin user is redhatocp.
Perform the following tasks to complete the comprehensive review:
A pod in the cluster is consuming excessive CPU and is interfering with other tasks. Identify the pod and remove its workload.
The
compreview-scaleproject already includes a web application at http://frontend-compreview-scale.apps.ocp4.example.com. When you access this URL, the application returns a list of quotations from famous authors. The application is broken for now, and is missing some configuration to be ready for production.The application uses two Kubernetes
Deploymentobjects. Thefrontenddeployment provides the application web pages, and relies on thequotesdbdeployment that runs a MySQL database. Thelabcommand already created the services and routes that connect the application components and that make the application available from outside the cluster.Fix the application and make it ready for production:
The
quotesdbdeployment in thecompreview-scaleproject starts a MySQL server, but the database is failing. Review the logs of the pod to identify and then fix the issue.Use the following parameters for the database:
Name Value Username operator1Password redhat123Database name quotesYou security team validated a new version of the MySQL container image that fixes a security issue. The new container image is
registry.ocp4.example.com:8443/rhel9/mysql-80:1-237.Update the
quotesdbdeployment to use this image. Ensure that the database redeploys.The classroom setup copied the image from the Red Hat Ecosystem Catalog. The original image is
registry.redhat.io/rhel9/mysql-80:1-237.Add a probe to the
quotesdbdeployment so that OpenShift can detect when the database is ready to accept requests. Use themysqladmin pingcommand for the probe.Add a second probe that regularly verifies the status of the database. Use the
mysqladmin pingcommand as well.Configure CPU and memory usage for the
quotesdbdeployment. The deployment needs 200 millicores of CPU and 256 MiB of memory to run, and you must restrict its CPU usage to 500 millicores and its memory usage to 1 GiB.Add a probe to the
frontenddeployment so that OpenShift can detect when the web application is ready to accept requests. The application is ready when an HTTP request on port 8000 to the/statuspath is successful.Add a second probe that regularly verifies the status of the web front end. The front end works as expected when an HTTP request on port 8000 to the
/envpath is successful.Configure CPU and memory usage for the
frontenddeployment. The deployment needs 200 millicores of CPU and 256 MiB of memory to run, and you must restrict its CPU usage to 500 millicores and its memory usage to 512 MiB.Scale the
frontendapplication to three pods to accommodate for the estimated production load.To verify your work, access the http://frontend-compreview-scale.apps.ocp4.example.com URL. The application returns a list of quotations from famous authors.