Hello and welcome to this section on multi container pods.
The idea of decoupling a large monolithic application into sub-components known as microservices enables
us to develop and deploy a set of independent small and reusable code this architecture can then help
us scale up down as well as modify each service as required as opposed to modifying the entire application
however at times you may need two services to work together such as a web server and a logging service.
You need one agent instance per web server instance paired together.
You don't want to march and bloat the code of the two services as each of them target different functionalities
and you'd still like them to be developed and deployed separately you only need the two functionality
to work together.
You need one agent per web server instance paired together that can scale up and down together and that
is why you have multi-container pods that share the same lifecycle which means they are created together
and destroyed together they share the same network space which means they can refer to each other as
local host and they have access to the same storage volumes.
This way you do not have to establish volume sharing or services between the pods to enable communication
between them to create a multi container pod.
Add the new container information to the pod definition file.
Remember the container section under the spec section in a pod definition file is an array.
And the reason it is an array is to allow multiple containers in a single pod.
In this case we add a new container named log agent to our existing pod.
Well that's it for this lecture.
Head over to the coding exercises section and practice configuring multi container pods.
See you in the next lecture.