The ambassador design pattern
When designing a multi-container Pod, you can decide to follow some architectural principles to build your Pod. Some typical needs are answers by these design principles, and the ambassador pattern is one of them.
Here, we are going to discover what the ambassador design pattern is, how to build an ambassador container in Kubernetes Pods, and look at a concrete example of them.
What is the ambassador design pattern?
In essence, the ambassador design pattern applies to multi-container Pods. We can define two containers in the same Pod:
- The first container will be called the main container.
- The other container will be called the ambassador container.
In this design pattern, we assume that the main container might have to access external services to communicate with them. For example, you can have an application that must interact with a SQL database that is living outside of your Pod, and you need to reach this database to retrieve...