Podman Deployment and Orchestration on CentOS 8

Podman is a free, open-source, and Linux-native tool designed for the purpose of running, building, sharing, and deploying applications through the use of containers. As a containerization engine, it provides the necessary infrastructure to manage containers, container images, and the volumes that are mounted into those containers. A defining characteristic of Podman is its daemonless architecture, meaning it does not rely on a central background process to manage container lifecycles. This structural difference is the primary reason Podman is rapidly gaining popularity among developers and system administrators as a viable replacement for Docker. By removing the daemon, Podman eliminates a single point of failure and enhances the overall security posture of the host system.

In the context of CentOS 8, Podman serves as a cornerstone for modernizing application deployment. Because CentOS 8 is an upstream fork, it aligns with the architectural trajectory of Red Hat Enterprise Linux (RHEL), positioning Podman as the primary tool for container management. The integration of Podman into the CentOS 8 ecosystem allows for the creation of OCI (Open Container Initiative) compliant containers, ensuring that workloads are portable across different container engines and cloud environments.

Hardware Specifications and Infrastructure Requirements

The performance and reliability of a containerized environment are heavily dependent on the underlying hardware. While Podman is efficient, the complexity of the workloads being deployed dictates the required resource allocation.

For a standard functional implementation on CentOS 8, a virtual machine can be provisioned with the following minimum specifications:

Component Specification
CPU 3.4 Ghz (2 cores)
Memory 2 GB
Storage 20 GB
Operating System CentOS Linux 8.0
Hostname podman-01.centlinux.com
IP Address 192.168.116.206 /24

The allocation of 2 GB of memory and 20 GB of storage provides a baseline for running a small number of lightweight containers, such as Alpine Linux. However, for professionals in the DevOps sector or Linux enthusiasts who require higher efficiency and versatility, moving beyond basic virtual machines is recommended. Investing in high-quality hardware, such as a Synology DS223j Network Attached Storage (NAS) device, provides the necessary data persistence and storage reliability for container volumes. Similarly, utilizing a mini PC like the Intel NUC 14 offers the computing power required to handle more intensive containerized workloads without the overhead of a full-scale server rack.

Architectural Analysis: Podman vs Docker

The choice between Podman and Docker is not merely a matter of preference but a strategic decision based on security requirements and existing infrastructure.

Podman excels in security and flexibility primarily due to its daemonless and rootless architecture. In a traditional Docker environment, a central daemon must be running with root privileges to manage containers. If the daemon is compromised, the attacker potentially gains root access to the entire host. Podman avoids this vulnerability by operating without a central daemon, allowing containers to be launched and managed by the user who starts them.

Docker, conversely, offers a more mature and comprehensive ecosystem. It possesses extensive tools and a massive community support network that has been established over a longer period. While Podman provides a compatible CLI, the underlying engine is designed to be more lightweight and secure.

The primary differences can be summarized as follows:

  • Daemonless Architecture: Podman operates without a central daemon, reducing the attack surface and removing a single point of failure.
  • Rootless Execution: Podman allows users to run containers without requiring root privileges, significantly enhancing the security of the host OS.
  • OCI Compliance: Podman focuses on building OCI (Open Container Initiative) compliant containers, ensuring interoperability.
  • Ecosystem Maturity: Docker provides a broader range of integrated tools and a larger community, though it relies on a daemon-based model.

The Container-Tools Ecosystem

Podman does not operate in isolation. On CentOS 8, it is part of a broader suite of containerization tools designed to handle different stages of the container lifecycle. These tools are often grouped together in the container-tools module.

The specific CLI tools included in this platform are:

  • podman: This is the primary client tool used for managing containers. It handles the creation, starting, stopping, and deletion of containers.
  • skopeo: A specialized client tool used for copying container images between different registries without requiring the image to be installed locally first.
  • buildah: A tool specifically designed for building OCI-compliant containers. It allows for the creation of images from a Dockerfile or by manipulating the container filesystem directly.
  • runc: The low-level container runtime client used for running and working with containers that follow the OCI format.

In the CentOS 8 yum repository, these utilities are available as individual packages. However, the most efficient method of installation is to use the container-tools module, which bundles these utilities together to ensure version compatibility and streamlined deployment.

Installation Procedures on CentOS 8

There are multiple pathways to install Podman on CentOS 8, depending on whether the administrator prefers the general dnf approach or the modular container-tools approach.

Method 1: Standard DNF Installation

For a basic installation, the EPEL (Extra Packages for Enterprise Linux) repository is required to ensure access to the latest packages.

  1. Install the EPEL release:
    dnf install epel-release -y

  2. Install the Podman package:
    dnf install podman -y

Method 2: Container-Tools Module Installation

The recommended approach for CentOS 8 is utilizing the module system, which provides a curated set of tools.

  1. Connect to the server (e.g., podman-01.centlinux.com) via SSH as the root user.

  2. Build the DNF cache to ensure the latest metadata is retrieved:
    dnf makecache

  3. Install the complete container-tools module:
    dnf install -y @container-tools

Installation for RHEL 8 Based Servers

For users operating on RHEL 8 based servers, a specific sequence of commands is required to enable the module before installation.

  1. Enable the container-tools module:
    yum module enable -y container-tools:rhel8

  2. Install the container-tools module:
    yum module install -y container-tools:rhel8

This process ensures that Podman, Buildah, and Skopeo are all available and properly configured for the RHEL environment.

Verification and System Inspection

Once the installation process is complete, it is critical to verify the installation and inspect the environment to ensure the container engine is functioning as expected.

Version Verification

To check the installed version of Podman, use the following command:
podman version

Depending on the installation method and repository, the output may vary. For example, a standard installation might return:
Version: 1.0.5
Go Version: go1.11.6
OS/Arch: linux/amd64

Alternatively, using the version flag may yield:
podman version 3.0.2-dev

Detailed System Information

For a comprehensive overview of the host environment and the Podman configuration, the info command is used:
podman info

The output of this command provides a dense web of technical data:

  • Host Details: Includes the architecture (amd64), the distribution (centos version 8), and the kernel version (e.g., 4.18.0-193.6.3.el8_2.x86_64).
  • Hardware Resources: Displays the total and free memory (e.g., memTotal: 4130037760) and the number of CPUs (e.g., cpus: 2).
  • Runtime Information: Identifies the OCI runtime as runc and provides the specific path (/usr/bin/runc) and version (e.g., 1.0.2-dev).
  • Conmon Details: Provides the path to the conmon utility (/usr/bin/conmon) and its version (e.g., conmon version 2.0.26).
  • Storage Configuration: Identifies the GraphDriver as overlay and the GraphRoot as /var/lib/containers/storage.
  • Registry Search: Lists the default registries used for image lookups, including:
  • registry.redhat.io
  • registry.access.redhat.com
  • quay.io
  • docker.io

Image Management and Registry Interaction

Podman allows users to find and pull images from various registries using a set of straightforward commands.

Searching for Images

To find an image, such as Debian or Alpine, the search command is utilized.

To find a Debian image:
podman search debian

To find an official Alpine image:
podman search alpine --filter is-official=true

The output of these commands typically includes the following columns:
- INDEX: The registry providing the image (e.g., docker.io).
- NAME: The full name of the image (e.g., docker.io/library/alpine).
- DESCRIPTION: A brief summary of the image.
- STARS: The popularity of the image.
- OFFICIAL: Whether the image is officially maintained.
- AUTOMATED: Whether the image is automatically built.

Using Help and Subcommands

Podman provides an extensive help system to guide users through its various functions.

To view the general help page:
podman --help

To view help for a specific subcommand, such as building an image:
podman build --help

The podman build command is used to create an image using instructions from one or more Dockerfiles and a specified build context directory.

Container Execution and Interaction

The final stage of the Podman workflow is running the containers and interacting with them.

Running Containers

Podman allows for the execution of containers in various modes. For users who need to interact with the container in real-time, the -i (interactive) and -t (terminal) options are used.

Example of connecting to an interactive session:
podman run -it [image_name] /bin/sh

This command allows the user to enter the container's shell and execute commands directly within the isolated environment.

Technical Analysis of Podman's Impact on CentOS 8

The deployment of Podman on CentOS 8 represents a fundamental shift in how containerization is handled on Red Hat-based systems. By moving away from the daemon-centric model of Docker, CentOS 8 users gain a system that is more resilient to crashes. In a Docker environment, if the daemon fails, all containers managed by that daemon may be affected or become unreachable. In Podman, since each container is managed as a child process of the user's shell (via conmon), the failure of one process does not impact others.

Furthermore, the integration with systemd allows Podman containers to be managed as standard system services. This means that containers can be configured to start automatically upon boot, restart upon failure, and be monitored using standard Linux system administration tools. This tight integration with the OS makes Podman a superior choice for production environments where stability and security are paramount.

The synergy between podman, buildah, and skopeo allows for a specialized pipeline: buildah creates the image, skopeo moves it to the registry, and podman deploys it. This separation of concerns ensures that the tool used for deployment does not need to carry the overhead of the tool used for building.

Sources

  1. How to Install and Use Podman on CentOS 8
  2. Install Podman on CentOS 8
  3. How to Install Podman on RHEL CentOS 7-8 Step by Step
  4. CentOS Podman Installation

Related Posts