Kubernetes: What and Why?

Last Updated on June 29, 2024 by KnownSense

what is Kubernetes and why the heck do we have it? If your legacy apps had tens or hundreds of VMs, there is a solid chance your modern microservices apps are going to have thousands of containers. And if that is the case, you need some help managing them. That’s where Kubernetes steps in.

Another thing is that we’ve kind of abandoned the traditional view of the cloud in the data center as a collection of individual computers. We’re more in favor of the more powerful idea, that the cloud or the data center is the computer, like a giant one. So, if we look at a computer at high‑level, it’s got processors, memory, persistent storage, networking. For the most part, application developers aren’t bothered about which CPU core or memory their apps are running on. We leave all of that up to the operating system. In real, the world of application development thrives on it. Well, say another hello to Kubernetes. We can basically say, hey, Kubernetes, I’ve got this app and it consists of these different services. Any chance you could just run it for me, please. You know what it does, Kubernetes goes off and does the hard stuff for us, like a super-smart courier company.

The Courier Analogy

If you like analogies, it’s a bit like sending packages via a courier service where we package up whatever we’re sending, obviously according to the courier’s packaging instructions, and then we slap a label on it and we give it to the courier and that is us done all the decisions of which routes to use or routes to use, which planes to use which motorways or highways, all of that is outsourced to the courier. So it’s kind of the same with Kubernetes. We package apps as containers, describe them in a declarative manifest file and then we just give them to Kubernetes. Then of course, behind the scenes, Kubernetes does all the work of deciding which nodes to run them on how to pull and verify images, start the containers attached to networks. All of that complexity. Kubernetes just takes care of it. Now, we’re super high level right now. But yeah, Kubernetes is the de facto platform for managing containerize applications at scale what we call cloud native microservices apps.

Cloud Native and Kuberenets

Monoliths Vs Microservices

Back in the day, we built applications as monoliths. Monolith is jargon for a massive honking application with all the features and functionality bundled into a single giant program. To be honest, it was a nightmare. Like, if you needed to patch just a tiny part of the app, you had to actually take the whole thing down, like there was no way to just patch or update a part of it. It was the same for scaling. You couldn’t scale individual parts. But now they are becoming an ancient relic, and we’re replacing them with Cloud Native microservices apps. Let’s understand microservices bit first. The old monolithic app did a bunch of different things, like, reporting, logging, authentication, inventory. But it was all built as a single app, which meant it had to be shipped and managed as a single unit. Well, each of these different features are kind of like services. So, the big old honking monolith had a reporting service, a logging service, authentication service and many more. Well, the microservices pattern takes this exact same set of small services and it breaks each one into its own mini application. Hence, the term microservices. But on the technical side, what it means is we can now manage all of them independently. So, let’s say we need to patch the reporting service. We can now do that without having to take everything else down.
Now, the most common pattern is to run each of these microservices as their own containers. So, a container for reporting, a container for authentication, a container for the web front end, and all the rest. Then, if we’re scaling reporting, we just add more reporting containers. Then, obviously, when year‑end is done, we scale it back by removing the extra containers. The point is, though, the overall app looks and feels the same, so users and consumers, they don’t know whether it’s microservices or monolithic, they just consume it in the same way and get the same results. It’s just that behind the scenes, it can all be managed way easier. Well, that’s the microservices part.

The Cloud Native Edge

The Cloud Native bit, this means it’s all scalable, dynamic, loosely coupled via APIs, and importantly, it can run anywhere we’ve got Kubernetes. Now, I always stress this. Cloud Native does not mean an app that only runs in public clouds. In fact, a core tenet of a Cloud Native app is this ability to run anywhere you’ve got Kubernetes. That can be the public cloud, but it can just as easily be a private cloud or even on‑premises. The point is, microservices is breaking out the different parts of a big app into smaller pieces that all talk over a network and give the overall same application experience. Then, the Cloud Native bit is the benefits that this microservices architecture enables. So, the granular scalability, the zero impact rolling updates, even things like self‑healing that we’ll see later, these are all the Cloud Native bits.

Conclusion

Kubernetes and the cloud is moving fast, so it’s super important you keep up‑to‑date. Kubernetes is a skill that is going to pay you huge dividends in the future. We will read more about technical aspects and k8s architecture in next articles.

Scroll to Top