The answer is quite simple containers within the pod can share Pod IP address and can listen on localhost. Now the question is how they will access the data between them and how the networking magic will happen.
![what is kubernetes pods what is kubernetes pods](https://thepracticaldev.s3.amazonaws.com/i/rfvpt1fawgau4h35qju6.png)
To solve the above problem I will just create 3 containers (application, log-shipper and APM agent) in the same pod. In a similar fashion, I can do the same thing with Kubernetes as well. Just like in real life if I have a two sitter bike and I want to take 3 persons on a ride, So I will add a sidecar in my bike to take 2 persons together on the ride. What if I tell you that Kubernetes has its own way of dealing situations like this. So again you have to recreate the container image with APM agent in it.ĭon’t you think this is quite an untidy way to do it? Of course, it is, why I have to add these things in my application image, it makes my image quite bulky and difficult to manage. Now you got another request to add application monitoring in the application.
#What is kubernetes pods install#
Now you have to add log shipper agent, In case of the container, you will install the log shipper in the container image. Let’s take an example, suppose you have an application which generates two types of logs one is access log and other logs are error log. Now after the context setting over pod I would like to answer my beloved question:- Why Pod over container? Pods are the one and only objects in Kubernetes that results in the execution of containers which means No Pod No Containers !!!
![what is kubernetes pods what is kubernetes pods](https://images.ctfassets.net/e6d9jibdbc6c/5WDJa3VObmmWqKswKOWmeC/be91ccd16fe1b7b3d9b16f2552d71885/Group_10-3.png)
The question that needs to be raised why pod?So let me clear this, pods are considered the fundamental building blocks of Kubernetes, because all the Kubernetes workloads, like Deployments, ReplicaSets or Jobs are eventually expressed in terms of pods. The bookish definition could be – a pod represents a request to execute one or more containers on the same node. The literal meaning of pod means the peel of pea which holds the beans and following the same analogy in Kubernetes pod means a logical object which holds a container or more than one container. But when I started diving deep in it I realized, there is a big rationale behind it and now I thank Kubernetes for making the Pod as an only object, not containers.Īfter being inspired by the working of a Pod, I would like to share my experience and knowledge with you guys. When I began my journey of learning Kubernetes, I always thought why Kubernetes has made the pod its smallest entity, why not the container.