Running Multiple Containers in a Single Pod

Learn to run a Pod with multiple containers.

Anatomy of a Pod

  • Pods are designed to run multiple cooperative processes that should act as a cohesive unit. Those processes are wrapped in containers.

  • All the containers that form a Pod are running on the same machine. A Pod cannot be split across multiple nodes.

  • All the processes (containers) inside a Pod share the same set of resources, and they can communicate with each other through localhost. One of those shared resources is storage.

  • A volume (think of it as a directory with shareable data) defined in a Pod can be accessed by all the containers, therefore allowing them all to share the same data.

We’ll explore storage and volumes in more depth later on. For now, let’s look at the go-demo-2.yml specification.

Get hands-on with 1400+ tech skills courses.