Kubernetes runs containers for your application workloads, but the containers themselves are not objects you need to work with. Every container belongs to a Pod, which is a Kubernetes object for managing one or more containers, and Pods, in turn, are managed by other resources. These higher-level resources abstract away the details of the container, which powers self-healing applications and lets you use a desired-state workflow: you tell Kubernetes what you want to happen, and it decides how to make it happen.
In this chapter, we’ll get started with the basic building blocks of Kubernetes: Pods, which run containers, and Deployments, which manage Pods. We’ll use a simple web app for the exercises, and you’ll get hands-on experience using the Kubernetes command-line tool to manage applications and using the Kubernetes YAML specification to define applications.
A container is a virtualized environment that typically runs a single application component. Kubernetes wraps the container in another virtualized environment: the Pod. A Pod is a unit of compute, which runs on a single node in the cluster. The Pod has its own virtual IP address, which is managed by Kubernetes, and Pods in the cluster can communicate with other Pods over that virtual network, even if they’re running on different nodes.