{"id":26713,"date":"2024-03-26T09:35:00","date_gmt":"2024-03-26T08:35:00","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=26713"},"modified":"2024-03-28T10:33:45","modified_gmt":"2024-03-28T09:33:45","slug":"two-feet-in-a-shoe-more-than-one-container-in-a-single-pod","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/","title":{"rendered":"Two feet in a shoe: more than one container in a single\u00a0Pod"},"content":{"rendered":"\n<p>Let\u2019s get it straight: it is wrong to have more than one application container inside a single Pod. There are different reasons behind this statement and I will mention just a few of them. In any cases, the way Kubernetes has been designed brings us to the fact that having just one application container per Pod gives us a lot more flexibility.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-two-application-containers-a-bad-nbsp-idea\">Two application containers: a bad&nbsp;idea<\/h2>\n\n\n\n<p>We have an application, made of various microservices. We deploy them using Deployments. In one of these <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/controllers\/deployment\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Deployments<\/a>, we choose to have 2 of our microservices, let\u2019s say Microservice A and Microservice B. The first releases for both microservices are tagged <code>v1.0<\/code>. Time goes by and we develop a second version of Microservice A, tagged <code>v2.0<\/code>. We deploy it, and the Deployment now have <code>v2.0<\/code> for Microservice A and <code>v1.0<\/code> for Microservice B. In the meanwhile, Microservice B\u2019s team worked to bring some minor enhancements, and we can deploy Microservice B <code>v1.1<\/code>. We update our Deployment and we now have a situation with Microservice A v2.0 and Microservice B v1.1. We update our Deployment and we now have the situation shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large caption-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"744\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16-1024x744.png\" alt=\"\" class=\"wp-image-26796\" title=\"Our Deployment's history\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16-1024x744.png 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16-300x218.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16-768x558.png 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16-1536x1116.png 1536w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/image-16.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Our Deployment\u2019s history<\/figcaption><\/figure>\n\n\n\n<p>While using the application, some of our users reported some serious bugs. We analyze the problem and notice that we must rollback Microservice A to <code>v2.0<\/code>. We go to our Deployment and\u2026 Oh, wait! We can\u2019t rollback without losing Microservice B\u2019s minor enhancements. We <strong>must<\/strong> then rollout a new version of our Deployment, containing <code>MicroserviceA:v1.0<\/code> and <code>MicroserviceB:v1.1<\/code>, instead of performing a rollback. That\u2019s definitely <strong>not<\/strong> how Deployments are intended to be used.<\/p>\n\n\n\n<p>Just a few more examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scalability<\/strong>: imagine there is a Horizontal Pod Autoscaler in place. You define that the autoscaler will add new replicas when the CPU consumption of a container reaches a certain threshold. If there are more containers in the same Pod, the autoscale will create new Pods, containing even the containers that don\u2019t need to scale and resulting in an excess of resources consumption;<\/li>\n\n\n\n<li><strong>Scheduling<\/strong>: just consider <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/scheduling-eviction\/assign-pod-node\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pod Affinity<\/a>. It is done at Pod level, so it affects every container that is inside the Pod. Or consider that the Scheduler will try to optimize resource consumption: having more containers, and consuming more resources, will result in less optimized scheduling.<\/li>\n<\/ul>\n\n\n\n<p>Is it then always wrong to have more than just one container inside a Pod? Well, there are some cases when it is rather convenient to use some companion containers, that will help the application container to do its job. What is important is to have only one application container.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-when-it-is-right-sidecar-adapter-and-ambassador-patterns\">When it is right: Sidecar, Adapter, and Ambassador patterns<\/h2>\n\n\n\n<p>Having understood that we should have only one application container in a single Pod, it is natural to imagine when it is right to have more than one container: when the other containers serve the main, application container. In which way? Well, the way they <strong>serve<\/strong> the application container tells us which design pattern we are using, and we have 3 of them: <strong>Sidecar<\/strong>, <strong>Adapter<\/strong> and <strong>Ambassador<\/strong> pattern. From a container point of view there is no difference: we just have a companion container that performs operations instead of making the application container do them. That is very convenient:\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the application container will not have to do things that are not related to the Business Cases that it resolves, resulting in a good <em>separation of responsibilities<\/em>;<\/li>\n\n\n\n<li>we have a modularity that allows us to easily change the companion container without having to change the application one. The containers are <em>loosely coupled<\/em> and very <em>maintainable<\/em>;<\/li>\n\n\n\n<li>having a set of companion containers reduces development time: we can <em>reuse<\/em> a lot of companions when we have to deal with the same problems.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Sidecar pattern<\/h3>\n\n\n\n<p>Think of all those cases where it is necessary to add essential functionalities, such as <em>logging<\/em>, <em>monitoring<\/em>, and caching. We could instrument our application, hard-coding those functionalities, or we can just write our code to solve our Business Cases. The companion object will add logging, monitoring, caching and similar functionalities, acting instead of our application, collecting logs and metrics, or caching frequently used datas.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Adapter pattern<\/h3>\n\n\n\n<p>Similar to what the GoF\u2019s Adapter Design Pattern can help us achieve, the Adapter pattern allows us to use a companion container to act as an object that translates the communications between the application container and the outside world. We can use it when, for example, we need to communicate with external APIs that use different data structures. Imagine having a lot of these external APIs, and an adapter can translate all of the data structures to the one used by our application. The same goes if we use a message broker to exchange messages: the adapter will translate the messages so the application can process them using just one structure. Whenever you need to bridge <em>communication gaps<\/em> with external systems, an adapter is the perfect choice.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ambassador pattern<\/h3>\n\n\n\n<p>An ambassador container acts as an intermediary, handling external requests and forwarding them to the application container. We can use it, for example, to enforce authentication and authorization policies before passing requests on to the application. Again, we can proxy the connection between the application and a remote database, providing a secure channel without forcing the application container to enforce the security on its own, simplifying its implementation. The ambassador pattern promotes increased control and agility. It allows you to implement security measures, optimize traffic flow, and manage application instances without modifying the core application container.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up the Pod: InitContainer<\/h2>\n\n\n\n<p>There are cases when the companion we need should only prepare the Pod, initializing it for the application. For example, we may need to clone a git repository in the locally mounted Volume, because the application will use the downloaded files. We may need to dynamically generate a configuration file. Or we may need to register the whole Pod with a remote server from the downward API. In these cases, Kubernetes gives us a powerful option: <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/init-containers\/\" target=\"_blank\" rel=\"noreferrer noopener\">InitContainers<\/a>.<\/p>\n\n\n\n<p>InitContainers are containers that run to completion during Pod initialization. We can define many of them, and each of them must run to completion before the application container starts. Kubelet will execute them sequentially, one after the other, in the order we define them. They are obviously different from a sidecar or an ambassador, as they will not be a companion. They will just set up the Pod for the application and stop. <\/p>\n\n\n\n<p>We can see an example of the definition of an InitContainer below. Note that <code>SERVICE_INITIALIZATION<\/code> and <code>DB_INITIALIZATION<\/code> are a placeholder for a generic command that will perform some initializations.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"YAML\" data-shcb-language-slug=\"yaml\"><span><code class=\"hljs language-yaml\"><span class=\"hljs-attr\">apiVersion:<\/span> <span class=\"hljs-string\">v1<\/span>\n<span class=\"hljs-attr\">kind:<\/span> <span class=\"hljs-string\">Pod<\/span>\n<span class=\"hljs-attr\">metadata:<\/span>\n  <span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">myapp<\/span>\n<span class=\"hljs-attr\">spec:<\/span>\n  <span class=\"hljs-attr\">containers:<\/span>\n  <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">myapp-container<\/span>\n    <span class=\"hljs-attr\">image:<\/span> <span class=\"hljs-string\">myapp-image<\/span>\n  <span class=\"hljs-attr\">initContainers:<\/span>\n  <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">init-myservice<\/span>\n    <span class=\"hljs-attr\">image:<\/span> <span class=\"hljs-string\">busybox:1.28<\/span>\n    <span class=\"hljs-attr\">command:<\/span> <span class=\"hljs-string\">&#91;'sh',<\/span> <span class=\"hljs-string\">'-C'<\/span><span class=\"hljs-string\">,<\/span> <span class=\"hljs-string\">'SERVICE_INITIALIZATION'<\/span><span class=\"hljs-string\">]<\/span>\n  <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">init-myservice<\/span>\n    <span class=\"hljs-attr\">image:<\/span> <span class=\"hljs-string\">busybox:1.28<\/span>\n    <span class=\"hljs-attr\">command:<\/span> <span class=\"hljs-string\">&#91;'sh',<\/span> <span class=\"hljs-string\">'-C'<\/span><span class=\"hljs-string\">,<\/span> <span class=\"hljs-string\">'DB_INITIALIZATION'<\/span><span class=\"hljs-string\">]<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">YAML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">yaml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This is a particular case of having multiple containers in a single Pod: effectively, InitContainers won\u2019t run simultaneously, but still, they will all be executed in the same Pod.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Sidecar, Adapter, and Ambassador patterns, together with InitContainers, are very useful approaches for all those jobs that, instead, would require the main application to change. They provide support for the main container and must be deployed as secondary containers. Which pattern we are using depends on the kind of work that the companion container does. Also, this way we have highly reusable containers for different use cases.\u00a0<\/p>\n\n\n\n<p>Just remember to not put more than one application container in the single Pod: having a companion is always helpful, but we don&#8217;t want to put two feet in the same shoe.<\/p>\n\n\n\n<div class=\"wp-block-uagb-container uagb-block-e9872698 alignfull uagb-is-root-container\"><div class=\"uagb-container-inner-blocks-wrap\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s get it straight: it is wrong to have more than one application container inside a single Pod. There are different reasons behind this statement and I will mention just a few of them. In any cases, the way Kubernetes has been designed brings us to the fact that having just one application container per&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\">Read more<\/a><\/p>\n","protected":false},"author":247,"featured_media":21223,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[5244],"tags":[],"collections":[],"class_list":{"0":"post-26713","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-cloud","8":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Two feet in a shoe: more than one container in a single\u00a0Pod - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let&#039;s see them in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Two feet in a shoe: more than one container in a single\u00a0Pod\" \/>\n<meta property=\"og:description\" content=\"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let&#039;s see them in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-26T08:35:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-28T09:33:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"gregoriopalama\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gregoriopalama\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"gregoriopalama\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\"},\"author\":{\"name\":\"gregoriopalama\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/346a4ef48c9a5d866a20bba8aa2b14ce\"},\"headline\":\"Two feet in a shoe: more than one container in a single\u00a0Pod\",\"datePublished\":\"2024-03-26T08:35:00+00:00\",\"dateModified\":\"2024-03-28T09:33:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\"},\"wordCount\":1234,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg\",\"articleSection\":[\"Cloud\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\",\"name\":\"Two feet in a shoe: more than one container in a single\u00a0Pod - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg\",\"datePublished\":\"2024-03-26T08:35:00+00:00\",\"dateModified\":\"2024-03-28T09:33:45+00:00\",\"description\":\"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let's see them in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg\",\"width\":1024,\"height\":1024,\"caption\":\"microservices digital transformation. From monolith to microservices concept.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cloud\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Two feet in a shoe: more than one container in a single\u00a0Pod\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/346a4ef48c9a5d866a20bba8aa2b14ce\",\"name\":\"gregoriopalama\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/palama-100x100.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/palama-100x100.png\",\"caption\":\"gregoriopalama\"},\"description\":\"I have been working in the IT industry for over 15 years. I currently deal with DevOps issues, Cloud Engineering, Cloud Native and everything that revolves around containerization and serverless at Lutech. I am Google Cloud Innovator Champion on the topic of modern architecture. I manage GDG Pescara together with other developers, I love sharing my knowledge and trying to do it in a fun way.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/gregorio-palam\/\",\"https:\/\/x.com\/gregoriopalama\"],\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/gregoriopalama\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Two feet in a shoe: more than one container in a single\u00a0Pod - Codemotion Magazine","description":"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let's see them in this article.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/","og_locale":"en_US","og_type":"article","og_title":"Two feet in a shoe: more than one container in a single\u00a0Pod","og_description":"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let's see them in this article.","og_url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2024-03-26T08:35:00+00:00","article_modified_time":"2024-03-28T09:33:45+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg","type":"image\/jpeg"}],"author":"gregoriopalama","twitter_card":"summary_large_image","twitter_creator":"@gregoriopalama","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"gregoriopalama","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/"},"author":{"name":"gregoriopalama","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/346a4ef48c9a5d866a20bba8aa2b14ce"},"headline":"Two feet in a shoe: more than one container in a single\u00a0Pod","datePublished":"2024-03-26T08:35:00+00:00","dateModified":"2024-03-28T09:33:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/"},"wordCount":1234,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg","articleSection":["Cloud"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/","url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/","name":"Two feet in a shoe: more than one container in a single\u00a0Pod - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg","datePublished":"2024-03-26T08:35:00+00:00","dateModified":"2024-03-28T09:33:45+00:00","description":"Is it ok to have more than one container in a single pod? Well, where are some cases when it is, and let's see them in this article.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg","width":1024,"height":1024,"caption":"microservices digital transformation. From monolith to microservices concept."},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/two-feet-in-a-shoe-more-than-one-container-in-a-single-pod\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.codemotion.com\/magazine\/devops\/"},{"@type":"ListItem","position":3,"name":"Cloud","item":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/"},{"@type":"ListItem","position":4,"name":"Two feet in a shoe: more than one container in a single\u00a0Pod"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/346a4ef48c9a5d866a20bba8aa2b14ce","name":"gregoriopalama","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/palama-100x100.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2024\/03\/palama-100x100.png","caption":"gregoriopalama"},"description":"I have been working in the IT industry for over 15 years. I currently deal with DevOps issues, Cloud Engineering, Cloud Native and everything that revolves around containerization and serverless at Lutech. I am Google Cloud Innovator Champion on the topic of modern architecture. I manage GDG Pescara together with other developers, I love sharing my knowledge and trying to do it in a fun way.","sameAs":["https:\/\/www.linkedin.com\/in\/gregorio-palam\/","https:\/\/x.com\/gregoriopalama"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/gregoriopalama\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-600x600.jpg","author_info":{"display_name":"gregoriopalama","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/gregoriopalama\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg",1024,1024,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-300x300.jpg",300,300,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-768x768.jpg",768,768,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg",1024,1024,false],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg",1024,1024,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg",1024,1024,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized.jpg",100,100,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2023\/06\/microservices-digital-transformation-optimized-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"gregoriopalama","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/gregoriopalama\/"},"uagb_comment_info":0,"uagb_excerpt":"Let\u2019s get it straight: it is wrong to have more than one application container inside a single Pod. There are different reasons behind this statement and I will mention just a few of them. In any cases, the way Kubernetes has been designed brings us to the fact that having just one application container per&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/26713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/247"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=26713"}],"version-history":[{"count":2,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/26713\/revisions"}],"predecessor-version":[{"id":26800,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/26713\/revisions\/26800"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/21223"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=26713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=26713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=26713"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=26713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}