Pods

109

A Pod is a Kubernetes abstraction that represents a group of one or more application containers (such as Docker), and some shared resources for those containers.

Those resources include:

  • Shared storage, as Volumes
  • Networking, as a unique cluster IP address
  • Information about how to run each container, such as the container image version or specific ports to use

Stuff you wanna know:

  1. Pods are designed to support multiple cooperating processes (as containers) that form a cohesive unit of service. A Pod is not a process, but an environment for running containers.
  2. Pods are typically created by controllers. Controllers for workload resources create Pods from a pod template and manage those Pods on your behalf.
  3. PodTemplates are specifications for creating Pods, and are included in workload resources such as Deployments, Jobs, and DaemonSets.
  4. Each Pod has an unique IP, persistent storage, and configuration information for containers.
  5. Agents on a node (e.g. system daemons, kubelet) can communicate with all pods on that node.
  6. When you create a Deployment on Kubernetes, that Deployment creates Pods with containers inside them (as opposed to creating containers directly).
  7. Each Pod is tied to the Node where it is scheduled, and remains there until termination (according to restart policy) or deletion.
  8. The containers in a Pod are automatically co-located and co-scheduled on the same physical or virtual machine in the cluster. These containers can share resources and dependencies, communicate with one another, and coordinate when and how they are terminated.
  9. Containers within a pod communicate via the localhost.
  10. Communications outside the pod is done via a port.
  11. Pods within the same cluster can communicate without NAT.
  12. A Pod models an application-specific “logical host”. It contains one or more application containers which are relatively tightly coupled.
  13. As well as application containers, a Pod can contain init containers that run during Pod startup.
  14. Each Pod is meant to run a single instance of a given application.
  15. Pods typically contain a single container; there can be pods with multiple containers that work together closely. For example, a Pod might include both the container with your Node.js app as well as a different container that feeds the data to be published by the Node.js webserver.
  16. If you want to scale your application horizontally (to provide more overall resources by running more instances), you could use multiple Pods, one for each instance.
  17. Pods are reusable.
  18. If a pod becomes overloaded, Kubernetes can replicate the pod and deploy it to the cluster.
  19. Pods are ephemeral. For example, say, a node in a cluster fails, making a pod on that node unresponsive. The controller detects the failure, and creates a replacement pod in a different node.

[Shout out to https://kubernetes.io/]

More stuff: