In Chapter 1 we described how the Pod primitive allows us to combine multiple con‐ tainers into a single unit. Behind the scenes, at runtime, a Pod is a container as well, but it starts as a paused process (literally with the  pause  command) before all other containers in the Pod. It is not doing anything other than holding all the Linux name‐ spaces the application containers use to interact throughout the Pod’s lifetime. Apart from this implementation detail, what is more interesting is all the characteristics that the Pod abstraction provides. The Pod is such a fundamental primitive that it is present in many cloud-native plat‐ forms under different names, but always with similar capabilities. A Pod as the deployment unit puts certain runtime constraints on the containers belonging to it. For example, all containers end up deployed to the same node, and they share the same Pod lifecycle. In addition, a Pod allows its containers to share volumes and communicate over the local network or host IPC. These are the reasons users put a group of containers into a Pod.  Sidecar  (in some places also called  Sidekick ) is used to describe the scenario of a container being put into a Pod to extend and enhance another container’s behavior. A typical example used to demonstrate this pattern is with an HTTP server and a Git synchronizer. The HTTP server container is focused only on serving files over HTTP and does not know how and where the files are coming from. Similarly, the Git syn‐ chronizer container’s only goal is to sync data from a Git server to the local filesys‐ tem. It does not care what happens to the files once synced, and its only concern is keeping the local folder in sync with the remote Git server. Example 15-1 shows a Pod definition with these two containers configured to use a volume for file exchange. 132  |  Chapter 15: Sidecar Example 15-1. Pod with Sidecar apiVersion : v1 kind : Pod metadata : name : web-app spec : containers : -  name : app image : docker.io/centos/httpd ports : -  containerPort : 80 volumeMounts : -  mountPath : /var/www/html name : git -  name : poll image : axeclbr/git volumeMounts : -  mountPath : /var/lib/data Solution