Kubernetes Namespaces Cheatsheet
Here is a list of container design patterns which can be used to create useful grouping of containers (atomic unit) such as Kubernetes pods:
These patterns advocates usage of additional containers to complement the primary / main container and have these containers form an atomic unit. The usage of additional containers as recommended by design patterns are based on some of the following design guidelines:
These patterns results in creation of atomic unit of containers with a set of containers acting as core containers and others as the ones complementing the core containers. These atomic units are called different in different container orchestration tools such as following:
Sidecar design pattern is a form of single-node, multiple containers application patterns. Sidecar pattern advocates the usage of additional container for extending or enhancing the main container. This container can be called as a sidecar pattern.
The following are some of the related examples:
Following diagram represents the same:
Figure 1. Sidecar container (logging) {image credit: design patterns}
Figure 2. Sidecar container (git synchronizer) {image credit: Kubernetes}
Ambassador pattern is another form of single-node, multiple containers application patterns. This pattern advocates usage of additional containers as proxies to the external group/cluster of servers. The primary goal is to simplify the access of external servers using the ambassador container. This container can be grouped as a logical atomic unit such that the application container can invoke this ambassador/proxy container which can, then, invoke the cluster of servers. The following is primary advantage of using ambassador container:
The following are some of the examples:
Figure 3. Ambassador (memcached) container
Figure 4. Ambassador (redis) container {image credit: Kubernetes}
Adapter pattern is yet another form of single-node, multiple containers application patterns. It advocates usage of additional containers to present a simplified, homogenized view of an application running within a container. These containers can be called as adapter container. The main container communicates with the adapter container through localhost or a shared local volume. This is unlike ambassador container which simply the access to external servers.
A concrete example of the adapter pattern is adapters that ensure all containers in a system have the same monitoring interface. The following diagram represents usage of adapter container for monitoring:
Figure 5. Adaptor (monitoring) container
Applying above container design patterns, Kuberentes pods can comprise of following containers in addition to main / application container.
Last updated: 25th Jan, 2025 Have you ever wondered how to seamlessly integrate the vast…
Hey there! As I venture into building agentic MEAN apps with LangChain.js, I wanted to…
Software-as-a-Service (SaaS) providers have long relied on traditional chatbot solutions like AWS Lex and Google…
Retrieval-Augmented Generation (RAG) is an innovative generative AI method that combines retrieval-based search with large…
The combination of Retrieval-Augmented Generation (RAG) and powerful language models enables the development of sophisticated…
Have you ever wondered how to use OpenAI APIs to create custom chatbots? With advancements…