liveBook · Manning

Chapter 8: Working with Kubernetes

What you will learn in chapter 8 of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

Introduces Kubernetes as the tool for orchestrating containers across machines and outlines how Podman helps developers work with Kubernetes YAML and run Podman in containers.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces Kubernetes as the tool for orchestrating containers across machines and outlines how Podman helps developers work with Kubernetes YAML and run Podman in containers.

Key terms: Podman, Kubernetes, CRI-O, container backend, microservices, Kubernetes YAML file, declarative language, podman play kube, continuous integration (CI), Podman within containers

8.1 Kubernetes YAML files

This section explains what Kubernetes YAML files do, why writing them can be difficult, and why Podman introduced `podman generate kube`.

Key terms: Kubernetes YAML file, desired state, declarative language, Kubernetes YAML, container command, image, options, podman generate kube, orchestrating, Kubernetes

8.2 Generating Kubernetes YAML files with Podman

This section shows how Podman turns an existing local container or pod into Kubernetes YAML, what that YAML contains, and where Kubernetes-specific editing begins.

Key terms: podman generate kube, podman rm --ignore, -f, --filename, -s, --service, pod specification, myapp-pod, myapp, image, command arguments, ports

8.3 Generating Podman pods and containers from Kubernetes YAML

This section shows how to start pods, containers, and volumes locally from Kubernetes YAML with Podman, inspect the result, and stop a simple pod.

Key terms: podman play kube, Kubernetes YAML, pod, container, volume, myapp-pod, myapp-pod-myapp, infra container, podman pod ps, --ctr-names

8.3.1 Shutting down pods and containers based on a Kubernetes YAML file

This section shows how to tear down pods created from Kubernetes YAML with Podman and why that workflow is useful.

Key terms: podman play kube --down, podman pod ps, volumes, Kubernetes YAML file, docker-compose, multinode, orchestrated environment

8.3.2 Building images using Podman and Kubernetes YAML files

This section shows how podman play kube --build builds images from local Containerfiles while launching an application from Kubernetes YAML, without first pushing images to a registry.

Key terms: podman play kube --build, podman build, container registry, image names, context directory, Containerfile, Dockerfile, mysystemd, podman generate kube, volumes

8.4 Running Podman within a container

This section introduces why people run Podman inside containers or Kubernetes pods and sets up an experiment with a purpose-built image and the requirements for nested containers.

Key terms: CI/CD, podman build, quay.io/podman/stable, rootful, rootless, container root, user namespace, capabilities

8.4.1 Running Podman within a Podman container

This section shows how to run Podman inside a container, including the capabilities it needs and the seccomp adjustment required when Docker runs the outer container.

Key terms: rootful Podman, rootless container, --privileged, CAP_SYS_ADMIN, quay.io/podman/stable, --user podman, CAP_SETUID, CAP_SETGID, --cap-drop=all, --cap-add

8.4.2 Running Podman within a Kubernetes pod

This subsection explains what Podman needs to run inside a Kubernetes pod and contrasts rootful and rootless Kubernetes YAML examples.

Key terms: CAP_SYS_ADMIN, CAP_SETUID, CAP_SETGID, UID, podman build, rootful, quay.io/podman/stable, privileged, runAsUser: 1000, podman user

8.5 Summary

The summary recaps how Podman turns local workloads into Kubernetes YAML, plays that YAML locally, and can run inside containers.

Where this is used later

Concepts explained in this chapter

← Chapter 7: Integration with systemd Chapter 9: Podman as a service →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.