7 Extending applications with multicontainer Pods

 

We met Pods in chapter 2, when you learned that you can run many containers in one Pod, but you didn’t actually do it. In this chapter, you’re going to see how it works and understand the patterns it enables. This is the first of the more advanced topics in this part of the book, but it’s not a complicated subject—it just helps to have all the background knowledge from the previous chapters. Conceptually, it’s quite simple: one Pod runs many containers, which is typically your app container plus some helper containers. It’s what you can do with those helpers that makes this feature so interesting.

Containers in a Pod share the same virtual environment, so when one container takes an action, other containers can see it and react to it. They can even modify the intended action without the original container knowing. This behavior lets you model your application so that the app container is very simple—it just focuses on its work, and it has helpers that take care of integrating the app with other components and with the Kubernetes platform. It’s a great way to add a consistent management API to all your apps, whether new or legacy.

7.1 How containers communicate in a Pod

7.2 Setting up applications with init containers

7.3 Applying consistency with adapter containers

7.4 Abstracting connections with ambassador containers

7.5 Understanding the Pod environment

7.6 Lab