Conf42 DevOps 2024 - Online

Kube-Nation: Exploring the Land of Kubernetes

Video size:

Abstract

Did you know that Kubernetes is one of the most complex pieces of machinery that’s used in the modern day? Its distributed nature makes it even more challenging to understand. What if we told you that you encounter such a complex piece of machinery daily? This machinery is a country

Summary

  • We will be understanding the architecture of Kubernetes in respect of an analogy of a country. Recently I've also gotten into fitness and health, so if you want to chat about that or just tech in general, feel free to hit me up on Twitter.
  • Kubernetes is the de facto container orchestration solution. It's also a really great distributed system. You can use it using multiple computers. But it's also very complicated and it's easy to get wrong.
  • We can't build a country without a land, right? Then we need some authority who will actually govern all the actions that is being taken place in the country. And we need homes so that those people can stay. All of this requires a communication set up.
  • The Kube API server is your entry point to a Kubernetes cluster. The components that pretty much govern the entire cluster. Each one of these nodes is a dedicated server or a dedicated computer within itself. And the containers are consistent like it's inside a pod.
  • The job of building all these pods and running the containers is handled by a component called the Kubernetes. The Kube proxy essentially handles all your networking related activities within the cluster. If you want to learn more about kubernetes then we've made a GitHub repository with a couple of resources.

Transcript

This transcript was autogenerated. To make changes, submit a PR.
Hey everyone, today we are really excited to present this talk, which is kubenation. And here we will be understanding the architecture of Kubernetes in respect of an analogy of a country. It will be really fun, it will be really visual. So we are really excited to present this talk to you all. So about us, I'm Aakansha Priya and I'm currently a deverel at empathyops. So I love going to meetups and conferences, love hosting spaces. And yeah, I also love to deep dive into new cloud native technologies. And I'm Siddhant Khisty, a developer advocate at Siglens. I am also one of co organizer at cloud native community groups NASC and I love to geek out around Linux, DevOps and various other technologies. Recently I've also gotten into fitness and health, so if you want to chat about that or just tech in general, feel free to hit me up on Twitter. So before we get into the fun stuff about actually building a nation, let's just get a very high level overview of what exactly is Kubernetes. So if you've gone ahead and googled a little bit around kubernetes, you'll hear that it's the de facto container orchestration solution. So thats. Does that exactly mean container orchestrator basically means that Kubernetes is instructing these tiny little things called as containers to go ahead and do something now. For now all you need to understand about containers is containers are a box which do something. Kubernetes is also used widely in our industry. Whether you go and look at a big company such as Google or Microsoft or Apple or Netflix, they are all using kubernetes at some level. It's also a really great distributed system. That means that you can use it using multiple computers. And these computers can be spread across the entire globe and it will still work. But Kubernetes is also very complicated and it's quite easy to get wrong. You might type one single letter in the wrong way in the Kubernetes configurations files, and you might have just opened up an entire range of security errors or performance issues. But we're not talking about Kubernetes today, so let's just throw it out of the window for now. And we will be actually building a nation, right? It sounds interesting. So we will be requiring a few checklist items. And those are like six main items that we will be requiring. First is land. Of course. We can't build a country without a land, right? Then we need some authority who will actually govern all the actions that is being taken place in the country, then we have people who will be staying in the country and working for the nation. And we need homes so that those people can stay. And of course, all of this requires a communication set up. So we require communication and then we need the hard workers who will be building the homes and doing the communication work, everything. So this is what we will be doing. Now, why do we require a land? As I mentioned, we need the land because we need to build our foundation on it, and it has all the resources, like the nutrients and minerals. And we need those resources to build our homes or supply food to our country people and so on. Now, how to actually acquire a land? There are a couple of ways. And first is that if you buy a land or you can get like someone rents you the land, then you can conquer the land. And of course not so suggested option, but you steal a land. Now, every country has a capital nation, which is like the main city in thats main city, all the authority people who will be actually governing the nation will be staying there after the capital is established. We need some cities, right? And so for example, we have taken Park City, industrial city and the night city. So if you are into gaming and all, you can actually understand the reference of night City. Now this nation will have some important stakeholders. So the first that comes up is the president, who is the face of the nation. He's the one who will take all the major important decisions. So if there is something that needs to be done for the country, all that communication will be like all the communication will go through the president, and all the important decision making skills will be in the hand of him. So he basically governs the nation. Now, of course, the president cannot run the whole country. He needs some people who are in the lower hierarchy and manage the nation. So we need some managers. And he makes sure that everything is working properly, every city is working properly, and people are having no communication problems, they are having no food problems and anything. Now making sure that the nation is healthy. So for example, if there is a terrorist attack or anything, it ensures that the city is working properly and it's in a stable state. Then comes the task manager, who basically does all the micromanagement of the people who are staying in those cities. He decides who does the work, ensures that the task that is being assigned to the person is being done, and also decides whom to give which task and where to give that task. And now all of this information is being stored at one central place. So for example, I want to look back to the tasks that were assigned in that city or if something went wrong, how it was called, I can actually go to that repository or that central reserve and see thats what was being done. So all the status, all the history reserves of the country are there. So now comes the home. This is a home. And there could be one person who is staying or there could be multiple people who are staying inside those homes. Now in the city there will be of course a neighborhood. So there are these four isolated homes and. Right, currently they have no communication and totally isolated. And in order for a city and a nation to work, we need to have communication set up. So we bring in telephones so any house can contact the adjacent house, right. Or even someone from the other city. So that's how communications are being set up. Then comes the hard workers who will be actually building those homes and who will be actually setting up the communication system. So when we talk about builders, they ensure it's very self explanatory that they will be building the houses. If the houses requires any maintenance work, they will be doing those. And they make sure that the people who are staying in those home are safe. And of course every city needs to accommodate every person who is part of the country, right? So they make sure thats the accommodation is well established in every city. Similarly, it goes for the communication that all the telephone providers or Internet providers are there in every specific city. They make sure that everyone can talk to each other. The messages are being delivered efficiently and timely. If there are any communication rules that needs to be enforced, they are responsible for that. And of course they ensure thats it is existing in every city of the country. So congratulations, you just learn the entire Kubernetes structure in a country form of way. But how it relates to the Kubernetes architecture in technical terms, I will now pass on to Sudant and he will be explaining that analogy. All right, so I'm pretty sure you had fun. If you've played makes like Simcity, for example, you probably could relate with a lot of the elements which we just talked about. Now let's bring it back to technical discussions for a while. Let's see how all these components for a country are relating to Kubernetes. So first of all, we had land. We explained land as the foundation for building a country, right? So in technical terms, this is just your servers, your computers, you have your ram, you have your cpu, you have your memory, you have your storage devices and all these other things. These are the resources which we are going to use for building our Kubernetes clusters. So we have our servers. Right now every single one of our cities is actually a server. And in Kubernetes terms we call them as nodes. Now the capital city, which we talked about, that has all the authority figures in terms of, in Kubernetes terminology we will call this as the control plane node. In some other ways to refer to it, you might also call it the master node. But the control plane node is basically where all your core Kubernetes components will exist. Then all your other node, all your other cities are just some regular nodes. Each one of these nodes is a dedicated server or a dedicated computer within itself. Kubernetes at the end of the day is just one control plane node and multiple other nodes or computers which are all being instructed how to work and how to orchestrate containers. Again, at the start we mentioned that containers are just a box that do something, right? Now let's see, what exactly are these important components within Kubernetes? The components that pretty much govern the entire cluster. So let's start off with replacing our president. We'll replace it with something that we call as the Kube API server. Now the Kube API server is again pretty much like the face of a Kubernetes cluster. The API server is your entry point to a Kubernetes cluster. All the requests that you make, all the actions that you make inside a cluster, they will all go through the Kube API server. Now from there you also have the controller manager. Now like we mentioned earlier, the controller manager. All it does is make sure that everything within the cluster is healthy, everything is running. If it's not working properly, it's the controller manager's duty to restart the process or heal the process. Then the task manager, which in Kubernetes terminologies is again called as the Kube scheduler. The scheduler basically decides thats actions to take and where to take them. For example, if I want to run some action in the park city node, the cube scheduler will instruct the components within the park city node to do it there. The scheduler makes sure that the actions are not executed in some other city, right? And then we have the central reserve which is just like a history books for the country. In Kubernetes that's what we call as the ETCD. Now in technical terms the ETCD is just like a database. Like for example, you have a SQL based database, you have MongoDB and all these other amazing databases. ETCD is a database in the same sense. But this one has been specifically created to work well with kubernetes. Yeah, so as I mentioned earlier, the homes and in these homes people were staying. So these people are actually the containers. And the containers are consistent like it's inside a pod. And these pods are represented by the homes, which is in the city itself. Now we also mentioned that you need some sort of communication between the homes, right? So we gave each houses its own telephone, but now instead of telephones we will assign each pod with a service. Now these services are of many different types. You have a service called as cluster IP, you have a service called as a node port, you have load balancers and these are the three main types of services within kubernetes. We won't go into the technical details of each of the services, but they essentially just help your pods communicate with each other. Now let's talk about the hardest workers within a Kubernetes cluster. So we talked about the builders and communication agencies who build your houses or rather build your pods and establish your networks. So within a Kubernetes cluster, the job of building all these pods and running the containers within the pods is handled by a component called as the Kubernetes. So this cubelet is going to exist within every single one of your nodes. Whether it's a regular worker node, whether it's your control plane node, doesn't matter. This Kubernetes will exist everywhere. And the second component which is essential within a Kubernetes cluster is the Kube proxy. The Kube proxy essentially handles all your networking related activities within the cluster. So again, just like the Kubernetes, even the Kube proxy will exist in every single node. And now we have gone through all of the core components of Kubernetes and if we visualize it, it looks something like this. So on the left we have the control plane with the API server, the control manager, the scheduler, the kubeproxy, and it also has the kubelet and the ETCD. And then we have our regular nodes which are our worker nodes. Thats is park city, industrial city and the night city node. Now the control plane node and the worker nodes, they can have absolutely any names, you just need to give them the proper name and you can work with them. So yeah, that's all for our talk. I hope you enjoyed. If you want to learn more about kubernetes then we've made a GitHub repository with a couple of resources and we've also shared these slides in that GitHub repository. So feel free to scan thats QR code to view those slides. And you can also follow us on our Twitter handles. They're right here. And, yeah, thanks for listening. Thanks for tuning in.
...

Siddhant Khisty

Co Organizer @ Cloud Native Nashik

Siddhant Khisty's LinkedIn account Siddhant Khisty's twitter account

Aakansha Priya

DevRel @ EmpathyOps

Aakansha Priya's LinkedIn account



Join the community!

Learn for free, join the best tech learning community for a price of a pumpkin latte.

Annual
Monthly
Newsletter
$ 0 /mo

Event notifications, weekly newsletter

Delayed access to all content

Immediate access to Keynotes & Panels

Community
$ 8.34 /mo

Immediate access to all content

Courses, quizes & certificates

Community chats

Join the community (7 day free trial)