chapter five
5 Running applications with pods
This chapter covers
- How and when to group containers
- Running an application by creating a Pod object from a YAML file
- Communicating with an application, viewing its logs, and exploring its environment
- Adding a sidecar container to extend the pod’s main container
- Initializing pods by running init containers at pod startup
Let’s quickly revisit the three types of objects created in chapter 3 to deploy a minimal application on Kubernetes. Figure 5.1 shows their correlation and the functions they have in the system.
Figure 5.1 Three basic object types comprising a deployed application
You now have a basic understanding of how these objects are exposed via the Kubernetes API. In this and the following chapters, you’ll learn about each of them and many others that are typically used to deploy a full application. Let’s start with the Pod object, as it represents the central, most important concept in Kubernetes—a running instance of your application.
Note
The code files for this chapter are available at https://mng.bz/64JR.