Kubernetes 101 - Networking overview

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.
Another essential aspect of Kubernetes is storage. In some instances, you will want to use some kind of storage solution. Because our pods can re-spool, die and recreate on the fly, we can't rely on storing elements on them. In many cases, we want so...
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...

A big part of Kubernetes is the networking capabilities, we get the option to internally route traffic to neighbouring pods, split workloads on multiple nodes and even open up networking to the outside world.
Let's take a closer look at some of the elements conform networking.
The first thing to note is that Kubernetes networking happens on a DNS level, every pod in a cluster receives it's own cluster wide unique IP address. This means we don't have to manualy set up mapping between the pods and Kubernetes can resolve connecitons easily for us.
There are a lot of benefits of doing it this way, mainly because the pods get randomly refreshed, and luckily for us Kubernetes can keep perfect track of this.
A big part of networking in Kubernetes is services, which are a abstract way to expose an application running on a set of pods. Kubernetes under the hood will assign unique IP addresses to each of them, but make them available with one single DNS name. It can also use this behaviour to load balance between the different pods.
What this comes down to is that we as the end user of the application can call my-service as the endpoint on whichever protocol we want.
And Kubernetes will know to call the correct pod, which could potentially have a different internal port number.
So far we looked at internal traffic within the cluster to other pods, this is pretty useful but it still means our application can't be accessed from the outside world.
To fix this we can use Ingress, which is an API object that manages external access to a service inside your cluster. (Typically via HTTP(S)).
When defining ingress resources we can define a set of rules about what the outside world will see (an endpoint) and what service this routes to inside Kubernetes internals.
When you are diving into networking in Kubernetes it's a big pool of many, many options you can use.
I would personally advice you to stick to the bare minium as described in this article and expand from here as to which use-case you will have to look into.
As always the Kubernetes documentation on this provides a massive amount of background information. (Which I tried to abstract to beginners).
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter