Certification Exams of Oracle Initialization scripts Managing stacks with pods Oracle and Linux Oracle Certifications Working directory

Managing stacks with pods – Lions, Tigers, and Containers – Oh My! Podman and Friends

Managing stacks with pods

Keeping everything organized with stacks and prepping for Kubernetes.

Podman supports concepts that do not exist in Docker. One of the big ones is pods – so I guess that’s where the name Podman derives from… Podman = Pod Manager. In this recipe, you will learn how to keep things organized by managing stacks with Podman. We’ll achieve this functionality through the use of pods. Pods consist of one or more containers. Because pods are the smallest deployable units that you can create and manage in Kubernetes, familiarizing yourself with pods will help you bridge the gap between containers and Kubernetes.

Getting ready

We will require the following:

  • Oracle Linux
  • Podman
  • Docker Compose

How to do it…

Before we jump into the recipe, we should first discuss a little more about pods. As mentioned previously, pods consist of one or more containers. Pods will always contain an infra container, which, by default is based on the k8s.gcr.io/pause image. The infra container basically does nothing but sleep – this ensures that the container continues to run even while idle, and it holds the port bindings, namespaces, and cgroups from the kernel. Once the pod is created, the attributes assigned to the infra container cannot be changed. It’s important to remember that any ports that need to be exposed will need to be done during the initial creation of the pod.

Outside of the pod exists a conmon (container monitor) instance that watches the primary process of the container. Each container has its own instance of conmon.

The following diagram provides an architectural overview of what makes up a pod.

Figure 11.3 – Architectural overview of a pod

Here are the Podman commands that relate to pods:
Manage pods
Description:
  Pods are a group of one or more containers sharing the same network, pid and ipc namespaces.
Usage:
  podman pod [command]
Available Commands:
  clone       Clone an existing pod
  create      Create a new empty pod
  exists      Check if a pod exists in local storage
  inspect     Displays a pod configuration
  kill        Send the specified signal or SIGKILL to containers in pod
  logs        Fetch logs for pod with one or more containers
  pause       Pause one or more pods
  prune       Remove all stopped pods and their containers
  ps          List pods
  restart     Restart one or more pods
  rm          Remove one or more pods
  start       Start one or more pods
  stats       Display a live stream of resource usage statistics for the containers in one or more pods
  stop        Stop one or more pods
  top         Display the running processes of containers in a pod
  unpause     Unpause one or more pods

As can be seen from the preceding commands, you can use the Podman CLI to create a pod and run your containers within the pod.

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *



Powered by keiarra.com