- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Advanced Container Management Using Podman on RHEL
Let’s take our container skills to the next level! In this lab, we’re going to step up our container management by adding storage, networking, monitoring, and more. Upon completion of this lab, you will be able to perform the foundational container management activities required for day-to-day container management.
Lab Info
Table of Contents
-
Challenge
Work with Container Storage
You will first work with Podman container storage!
Container Storage Using a Directory
- Create a directory named
~/html. - Create 3 text files in your new
~/htmldirectory:- Name these
test1.txt,test2.txt, andtest3.txt. - Make the contents "Test File 1", "Test File 2", and "Test File 3".
- Name these
- Start 3
nginxcontainers:- Name them
web1,web2, andweb3. - Attach the
~/htmldirectory to the container at/usr/share/nginx/html/.
- Name them
- Run a
curlcommand inside each container to test.- Try pulling each of your text files.
- Stop and remove all 3 containers.
Container Storage Using a Container Volume
- Create a new container storage volume named
webvol. - Start 3
nginxcontainers:- Name them
web1,web2, andweb3. - Attach the
webvolvolume to the container at/usr/share/nginx/html/.
- Name them
- Copy the 3 text files from
~/htmlinto theweb1container to the/usr/share/nginx/html/directory. - Run an
lscommand inside of each container to list the contents of the/usr/share/nginx/html/directory.- You should see the 3 text files.
- Run a
curlcommand inside each container to test.- Try pulling each of your text files.
- Stop and remove all 3 containers.
You can now proceed to the next objective!
- Create a directory named
-
Challenge
Configure Container Networking
Now you can make your
nginxweb servers available outside of their containers!Publish Your Web Servers' Ports
- Start 3
nginxcontainers:- Name them
web1,web2, andweb3. - Attach the
webvolvolume to the container at/usr/share/nginx/html/. - Publish the containers' port
80:8081(web1)8082(web2)8083(web3)
- Name them
- Check the published container ports.
- Run
curlcommands on your host:- Pull the 3 test text files from the 3 web server containers.
- Stop and remove all 3 containers.
Now you can try setting up some container healthchecks!
- Start 3
-
Challenge
Use Container Healthchecks
Now that you have your web server containers up and running with shared storage and networking, add a check that validates that
nginxis available.Configure Healthchecks For Your Web Servers
- Start 3
nginxcontainers:- Name them
web1,web2, andweb3. - Attach the
webvolvolume to the container at/usr/share/nginx/html/. - Publish the containers' port
80:8081(web1)8082(web2)8083(web3)
- Add a healthcheck for each server:
- 'curl http://localhost || exit 1'
- Set the healthcheck interval to
0
- Name them
- Run
curlcommands on your host.- Pull the 3 test text files from the 3 web server containers.
- Run the healthchecks for all 3 servers.
- Validate that the
nginxservice ishealthyon all 3 servers.
- Validate that the
Your containers are looking great now! Now you can take a look at your Podman host.
- Start 3
-
Challenge
Manage Your Podman Environment
With healthy containers, check out the host.
Managing Your Podman System
- Display system information for your Podman host.
- Display Podman's disk space utilization.
- Use regular and verbose modes.
- Clean up unused data using
prune. - Display Podman's disk space utilization again.
All cleaned up!
Monitoring Your Podman System
- Take a look at events from the last 10 minutes.
- Display all
pruneevents for the past 15 minutes.
Looks good!
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.