chapter two

2 What is a Pod? A brief jaunt into Kubernetes objects

 

This chapter covers:

  • Pods and other Kubernetes objects
  • Kubernetes Deployments: the common sources of Pod objects
  • The schema of various Kubernetes objects in the form of YAML
  • Pod Priorities

If you understand the concept of Pods, Deployments, and the basic Kubernetes API patterns, you probably can skip over this chapter, but it is not a long read, and you may glean something new. Pods are the atomic unit of execution in Kubernetes, and we’ve mentioned before that they are a significant differentiator between Kubernetes and its predecessor runtimes, like Mesos, Docker Swarm, and cloud container execution environments such as Amazon’s Elastic Container Service (ECS). As abstractions such as Helm charts and operators become more commonplace, it is easy to overlook the fact that Pods can manifest through many different pathways in the Kubernetes API. If you’ve ever wondered whether a Deployment, StatefulSet, or DaemonSet was the ideal solution for your distributed app, this is the chapter for you.

There are several different higher-level controllers in Kubernetes that create and manage Pod lifecycles. The most common source of Pods in a Kubernetes cluster is a Deployment, so we’ll cover that first. Then we’ll go through StatefulSets and DaemonSets, which are essential for various types of critical workloads in your cluster.

2.1  The anatomy of a Pod

2.2  Deployments, the most common source of Pods

2.3  StatefulSets

2.3.1  ServiceNames, VolumeClaimTemplates, and introspection of Pod IP addresses

2.4  DaemonSets

2.4.1  Kube-proxy and CoreDNS: When you do (and don’t) need a DaemonSet

2.5  Jobs

2.5.1  Job termination and cleanup

2.6  Init Containers

2.6.1  Pods: Taints and tolerations

2.7  Prioritizing Pods

2.8  Setting Cluster Resource Usage: Resource Quotas

2.9  Summary