Run a web server as a pod and insert a debug page that displays diagnostic information.
Outcomes
Deploy a pod from a container image.
Retrieve the status and events of a pod.
Troubleshoot a failed pod.
Edit pod resources.
Copy files to a running pod for diagnostic purposes.
Use port forwarding to connect to a running pod.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that exercise resources are available.
[student@workstation ~]$ lab start pods-review
Procedure 3.4. Instructions
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.
Log in to the OpenShift cluster as the developer user with the developer password.
Use the pods-review project for your work.
Log in to the OpenShift cluster and change to the pods-review project.
Show Solution
Deploy a pod named webphp that uses the registry.ocp4.example.com:8443/redhattraining/webphp:v1 container image. Determine why the pod fails to start.
Show Solution
Troubleshoot the failed webphp pod by creating a debug pod.
Show Solution
The application developer resolved the identified issue in the registry.ocp4.example.com:8443/redhattraining/webphp:v2 container image. In a terminal window, edit the webphp pod resource to use the v2 image tag. Retrieve the status of the webphp pod. Then, confirm that the user in the container is an unprivileged user and belongs to the root group. Confirm that the root group permissions are correct for the /run/httpd directory.
Show Solution
Connect port 8080 on the Workstation machine to port 8080 on the webphp pod. In a new terminal window, retrieve the content of the pod's 127.0.0.1:8080/index.php web page to confirm that the pod is operational.
NOTE
The terminal window that you connect to the webphp pod must remain open for the remainder of the lab. This connection is necessary for the final lab step and for the lab grade command.
Show Solution
An issue occurs with the PHP application that is running on the webphp pod. To debug the issue, the application developer requires diagnostic and configuration information for the PHP instance that is running on the webphp pod.
The ~/DO180/labs/pods-review directory contains a phpinfo.php file to generate debugging information for a PHP instance. Copy the phpinfo.php file to the /var/www/html/ directory on the webphp pod.
Then, confirm that the PHP debugging information is displayed when accessing the 127.0.0.1:8080/phpinfo.php from a web browser.

Show Solution
Evaluation
As the student user on the workstation machine, use the lab command to grade your work. Correct any reported failures and rerun the command until successful.
[student@workstation ~]$ lab grade pods-review
Finish
As the student user on the workstation machine, use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.
[student@workstation ~]$ lab finish pods-review