- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Red Hat EX180 Practice Exam
The Red Hat Certified Specialist in Containers and Kubernetes exam (EX180) tests your skills and knowledge of the fundamentals of containers and OpenShift, including the ability to find, customize, run, and manage containerized services in both standalone environments and environments with both Kubernetes and OpenShift. Now that you've gone through all the objectives, it is time to test your newfound knowledge on the practice exam to prepare for the real exam! In this lab, you will be asked to perform a series of tasks similar to what you will be asked to do in the actual exam. Good luck, and please use this practice exam as many times as you need before taking the exam. *This course is not approved or sponsored by Red Hat.*
Lab Info
Table of Contents
-
Challenge
Run and Manage Containers
Task 1.
- Configure
Podmanto search the registryregistry-1:5000last. - Configure the registry as an insecure registry.
Task 2.
- Pull the latest Nginx image
docker.io/library/nginx. - Start a container using the Nginx image with the following:
- Name =
web-vol - Mount local directory
/home/cloud_user/webto container as/usr/share/nginx/html - Run the container in the pod named
task-2by using the podman option--pod task-2
- Name =
- Verify you can access the web page by using
curl localhost:8081. - Save a copy of the container logs to a file named
web-vol.log.
Task 3.
- Pull the latest MySQL image
docker.io/library/mysql. - Start a container using the MySQL image with the following:
name=mysql-llamaMYSQL_PASSWORD=badpassMYSQL_USER=guruMYSQL_ROOT_PASSWORD=supersecretMYSQL_DATABASE=llama- Publish port
3306on the container to port3306on the localhost
- Verify the MySQL instance is running with the following command, and check that the llama database is there:
echo "show databases;" | mysql -uguru -pbadpass --protocol tcp -h localhost
- Make a directory named
mysql_logsand copy the log file/var/lib/mysql/mysql/general_log_213.sdito the directory.
Task 4.
- Start a Nginx container from
registry-1:5000using a tag that is NOTlatest. Use the following parameters:name=web-default- Publish port
80in the container tolocalhostport8080
- Verify you can access the web page with
curl localhost:8080. - Start a Bash shell on the container and modify
/usr/share/nginx/html/index.htmlin the container, then change the current message toA guru was here!. - Verify you can access the web page with
curl localhost:8080and see your new message. - Commit the modified container to a new image named
registry-1:5000/nginx:web-guru.
- Configure
-
Challenge
Build and Run Custom Images
Task 5.
- Push your new image to
registry-1:5000. - Stop the container
web-defaultand start a new container using your new image. Use the following parameters:
name=web-guru- Publish port
80in the container tolocalhostport8080
- Verify you get your custom message with
curl localhost:8080. - Save your new image as a tar file named
guru-web.tar.
Task 6.
- Complete the incomplete Dockerfile located at
/home/cloud_user/docker/Dockerfile. Details are listed in the incomplete Dockerfile.
Task 7.
- Build an image from the completed Dockerfile in task 6. The image should be built with the following:
name=llama-carttag=v1
- Start a container with the new image using the following settings:
name=llama=web- Publish port
90in the container tolocalhostport8090
- Verify the image works by putting your lab-system-name:8090 or IP-Address:8090 into a web browser.
- Alternatively, use
curl localhost:8090and see just the text version of the page.
- Alternatively, use
- Push your new image to
-
Challenge
Creating Applications with OpenShift
Task 8.
- Create a new project.
- (CodeReady Containers only)
- Create a new project named
guru-phpwith display name ofTest hello guru project
- Create a new project named
- (Red Hat OpenShift Sandbox)
- Skip this and use default project
username-dev
- Skip this and use default project
- (CodeReady Containers only)
- Create a new PHP application with the following:
- Git repo
- Use the Git repo context directory
php-hello-world - Create app as a deployment config
- Label
app=hello-guru
Task 9.
- Create a new project.
- (CodeReady Containers only)
- Create a new project named
inventory
- Create a new project named
- (Red Hat OpenShift Sandbox)
- Skip this and use default project
username-stage
- Skip this and use default project
- (CodeReady Containers only)
- Download the following template:
- Publish the template to the current project.
- Process the template and save to a file named
processed_template.yaml. Set the following parameters and label:NAME=fruit-standDATABASE_NAME=fruit_standDATABASE_USER=guruDATABASE_PASSWORD=badpassDATABASE_ADMIN_PASSWORD=badidealabel app=guru-fruit
- Create the application using the saved file
processed_template.yaml.
Task 10.
- Create the following directories inside your home directory:
logs/pod-fruit-standlogs/pod-postgres
- Sync the directory
/var/logfrom each running pod to previously created directories.- Put the logs from the fruit-stand application pod in
logs/pod-fruit-stand - Put the logs from the postgresql application pod in
logs/pod-postgres
- Put the logs from the fruit-stand application pod in
- Create a new project.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.