- Lab
- A Cloud Guru
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.
Path 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
~/html
directory:- 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
nginx
containers:- Name them
web1
,web2
, andweb3
. - Attach the
~/html
directory to the container at/usr/share/nginx/html/
.
- Name them
- Run a
curl
command 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
nginx
containers:- Name them
web1
,web2
, andweb3
. - Attach the
webvol
volume to the container at/usr/share/nginx/html/
.
- Name them
- Copy the 3 text files from
~/html
into theweb1
container to the/usr/share/nginx/html/
directory. - Run an
ls
command inside of each container to list the contents of the/usr/share/nginx/html/
directory.- You should see the 3 text files.
- Run a
curl
command 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
nginx
web servers available outside of their containers!Publish Your Web Servers' Ports
- Start 3
nginx
containers:- Name them
web1
,web2
, andweb3
. - Attach the
webvol
volume 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
curl
commands 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
nginx
is available.Configure Healthchecks For Your Web Servers
- Start 3
nginx
containers:- Name them
web1
,web2
, andweb3
. - Attach the
webvol
volume 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
curl
commands 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
nginx
service ishealthy
on 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
prune
events for the past 15 minutes.
Looks good!
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.