Kubernetes 101 - Pods

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
No comments yet. Be the first to comment.
For this article we'll be looking a bit more in detail into containers. Containers are ready to run software packages, meaning they include everything: code runtime if required application system libraries Once something is converted into a contain...
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

I wanted to explore Pods in more detail as they are quite an essential aspect of the Kubernetes ecosystem.
You can take the name Pod as the literal sense of "pod of whales" or "pea pod," meaning it's one single element in a group of elements.
In the technical sense, a pod is a group of containers with shared storage and network resources. The pods' content is always co-located, co-scheduled, and run in a shared context.
So what exactly is this container we can run on it? It comes down to your application container. For the sake of simplicity, imagine each pod can run a docker container. Depending on your setup, it can run multiple containers inside one architecture.
Pods are cheap systems. Kubernetes can quickly spool them up, destroy them or replace them. It takes little to no effort to replace pods, meaning they are stateless and pure.
As mentioned, most of the time, it runs one container, but in some cases, it can run a closed system that needs multiple containers. (Imagine app + background worker).
You might be wondering why don't we deploy the container directly. Why is the pod layer needed?
The most straightforward answer to this question is that pods can access shared resources on the local network, meaning they can communicate between them. If we again group the containers they run in, they have yet another way of communicating with the outside pods.
Another reason is their health system in place, making them easily detectable on failure, telling the controller to kill it and spool up a new one.
Because of this setup, it also means pods are the replicable elements. This basically comes down to Kubernetes being able to automatically create replicas of the system running on the pod.
With this system in place, we can scale horizontally when our load gets higher or have 99% uptime due to replicas on different data sets.
Keep in mind this is solely possible due to the single responsibility of one pod. If this were not the case, it would become impossible to scale them across the board.
I want to note that you'll never have to create pods manually. This is all managed by the controller.
By doing this, Kubernetes can use resources to their fullest by only spooling up the pods we actively need and managing their workload across different nodes.
A side note is that you can manually create them, but unless things go south, I strongly advise against this.
Pods are the smallest entity in Kubernetes. Your containers are deployed on nodes.
Pods are managed by the controller and are treated as single-task things. Meaning they are cheap, easy, and stateless. By doing this, Kubernetes can spool them up quickly and destroy them as it sees fit.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter