liveBook · Manning

Kubernetes

As explained in Data Pipelines with Apache Airflow, Second Edition

A Kubernetes cluster is a set of machines managed by Kubernetes that provides pooled resources for running containerized workloads.

Kubernetes is an open-source container orchestration platform for deploying, scaling, and managing containerized applications across a cluster of machines. It is useful when Docker on one machine cannot distribute work or scale across multiple machines. section 11.5 section 11.5.1

A Kubernetes deployment separates management from execution:

  • The control plane exposes the API server, scheduler, and services for managing deployments and storage. section 11.5.1
  • Worker nodes run the applications assigned by the scheduler. section 11.5.1
  • Pods are Kubernetes’s smallest work units; an Airflow task runs as a container inside one pod. section 11.5.1
  • Scheduling can account for CPU, memory, storage, and special hardware such as GPUs. section 11.5.1

Running an Airflow task with Kubernetes

Prepare a cluster and install kubectl, then create an airflow namespace. Define a persistent volume and storage claim with YAML, apply them with kubectl, and deploy the MovieLens API as a Kubernetes deployment and service. Airflow can then run containerized tasks in pods, while Kubernetes places those pods on suitable worker nodes. Unlike Docker-based execution, task resources and storage belong to the Kubernetes environment rather than the Airflow worker. section 11.5.2 section 11.5.5

Figure 11.10 High-level overview of Kubernetes

Use the architecture figure to trace the control plane, worker nodes, and containerized workloads. section 11.5.1

Kubernetes improves scalability, workload-specific resource placement, storage, and secret management, but requires maintaining a cluster. Airflow itself can also run inside the cluster. section 11.5.5

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains orchestration architecture and setup workflows, but stops short of a comprehensive Kubernetes treatment.
Examples
Uses kubectl commands, YAML resources, an airflow namespace, persistent storage, and a deployed MovieLens API.
What it assumes
Assumes containerized task familiarity, then introduces clusters, control planes, worker nodes, pods, and storage setup at a high level.
What you can do after
Operate Kubernetes-backed Airflow workloads and deploy supporting services, storage, and namespaces with kubectl and YAML.
How it connects
Connects container orchestration with Docker, Airflow, pods, persistent storage, secrets, and resource-aware scheduling.

Also explained in

Compare how 22 books explain Kubernetes →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.