Hey, everyone.
And welcome back.
Now, in the earlier video, we had a great introduction to container orchestration engine.
Now, we already had discussed that there are multiple orchestration engines.
So you have Docker swarm, you have Apache missiles, you have Kubernetes, and you have various others.
So by far, Kubernetes is one of the most popular container orchestrator engine, which is available.
And in today's video, we'll have a high level introduction to Kubernetes, followed by certain short
demos as well.
Now, Kubernetes is an open source container orchestration engine, which is developed by Google.
So Kubernetes was completely developed and maintained by Google, and it was later handed over to the
C and ZF, which is the Cloud Native Computing Foundation, which is currently managing it.
So Kubernetes is also referred as the k8s in short form.
So the reason why you have k8s is because between K and between S, you have eight characters over here.
And this is the reason why it is referred as the K.
It is now speaking about the architecture of the Kubernetes.
You have a Kubernetes master over here and you have the worker nodes.
So worker nodes are basically the physical servers or the virtual machines where the containers would
be running.
And Kubernetes master is the one who will be managing the containers.
So the Kubernetes master will basically receive the commands from the users.
Now, the question is, how will it receive the commands?
So it can receive the commands via API, it can receive it via CLI, and it can also receive via UI.
So you have API CLA and GI through which users will be able to send the commands to the Kubernetes master
and Kubernetes master will process the things which are mentioned within the commands.
So let's understand this with a simple analogy.
So let's say that you have a command called as I want to launch App A.
So this is the command that you give to Kubernetes, master.
So now Kubernetes master will check that how many nodes that it has.
So currently there are three nodes which are associated with the Kubernetes master.
So it will go ahead and launch the application in one of the nodes.
Now, there are various algorithms based on which a specific node is selected, so it is not like that
node A currently is having 100% of the CPU load.
So in that case, Kubernetes master will not really send the application to Node one.
It will send it to the node which has more resources which are available.
So there are a lot of things which are happening behind the scenes, but currently we are just looking
at a high level overview over here.
All right.
So currently you have the command which has been supplied by the user Kubernetes is master took it and
it launched the container in one of the worker nodes.
Now, let's say that you do some reason this worker node has stopped working.
There can be a reason why the server stopped working due to power issue, network connectivity, kernel
issue, and various others.
So now, once this worker node has stopped working, Kubernetes master will automatically detect it.
So it automatically detects that the worker node is not really working well and it migrates the container
to a different running worker node.
So this is also referred as the record of intent.
So what record of intent basically is So this is the record of intent at a high level overview.
So the record of intent is generally given by the user, which states that I want to launch app a container.
So this is the app container.
And as a user I tell the Kubernetes OC, I want to launch the app container, and that's about it.
Now I don't have to do anything else.
Kubernetes will take care of both launching the container as well as managing it in the longer term.
So as we were discussing, it's not just about launching the container one time.
It is also about the health check.
Kubernetes master can not only detect that the node is down, it can also detect if the app is not working
properly.
And if the app container is not working properly, it can automatically restart the app container.
It can automatically migrate the app container to different worker nodes and various others.
So there is a lot of things which is happening behind the scenes.
So in today's video, our main focus was on the introduction.
So we are just looking at a high level overview about how things work.
So let's quickly jump into the demo so that we understand more about it.
So I'm in my class and let's quickly do a cube.
Get nodes.
And currently you see that I have one node which is available.
So we were discussing during the architectural phase that you have a Kubernetes master and then you
have multiple worker nodes.
So worker nodes are basically where the containers would be deployed.
So worker nodes can be one, it can be 100, it can even be 1000.
So that really depends.
So for our demo, we have one worker node, which is currently available.
Now, in the next slide, we were discussing about the record of intent, where through one of the mediums
it can be API clear, we supplied a record of intent.
So the record of intent was I want to launch app a container, so let's try it out.
So I'll say it'll run, I'll call it as Engine X and I'll launch it from the image of engine X.
Now you do not need to worry about what these commands are right now.
We'll be discussing about these in great detail in the upcoming video.
This specific video is just to give you a gist about the Kubernetes.
So once you run this, it says the deployment engine is created.
And now if you do a cube, it'll get ports.
You will see that you have one pod which is currently in the creating stage.
So what exactly happened?
We told Kubernetes is that we want to launch a container from the engine X image.
So this is the part that we had done, and this was supplied to the Kubernetes master.
Now, Kubernetes master will look into the worker nodes and then it will launch that specific pod in
one of the worker nodes.
So you can refer pod as a container to begin with.
So Kubernetes has basically launched the container in one of the worker nodes.
So now if you just refresh, you will see that the status of this current board is in the running state.
So now this pod is currently running in my server where we are running the CLI commands.
So if I do a Docker piece on the engine X, in fact, let me copy this name.
You're you will see that you have one container of engine which is up and running.
So now let's do one thing.
Let's stop this container and see what exactly happens.
So I'll say, Docker, stop.
Followed by the container.
And now if you do a Docker piece, you should see that the first container that we had stopped, it
is no longer present over here.
So now looking into the architecture.
So what we had done, we told the Kubernetes to launch a container from the engine X image.
Kubernetes went ahead and it created the container.
So now what we did, instead of deleting the node, what we did, we manually we stopped the container.
Or you can say we killed the container.
So now Kubernetes will be able to detect that this container is no longer working and it can automatically
start it or it can automatically start a new container in a different node altogether.
So if you want to see again, let's do a Docker piece and you will see that one more container got launched.
So this container was launched before 53 seconds.
So this is one of the great features of a typical orchestrator engine, which is Kubernetes in our case.
So I hope at a high level, all of you understood what Kubernetes is.
Now, again, this is just one of the examples that we had taken.
Now, Kubernetes has a lot of features, and we'll be discussing about them as we progress throughout
the course.
Now, before we conclude this video, I just wanted to show you one more thing.
So we were discussing that there were three ways in which you can supply the commands to Kubernetes.
Master, You have the API, you have the ClA, and you have the UI.
So the CTL command that we were running in this demo was an example of CLI.
You also have the feature of UI.
So if you want to see how exactly Java looks like, this is the UI dashboard for Kubernetes.
So currently if you see over here within the nodes, it is showing that there is one worker node which
is available.
It also shows you the CPU as well as the memory related specifications of that specific worker node.
Now, along with that, it can also show you various information about the current containers which
are running the daemon sets, deployments, etc. So this is a great GI which is available and it really
helps to understand things in a quicker way because UI is always the quick way to demonstrate things.
So this is the GI.
We also had looked into the CLI and definitely you can even supply commands via API.
So that's the high level overview about Kubernetes.
Again, we had a very high level overview in today's video.
I hope you got a gist about what Kubernetes is and what are the things that it can do.
Now, in the upcoming videos, we'll be going in detail about the Kubernetes, and we'll be looking
into a lot of features which the Kubernetes orchestrator engine provides.
So with this will conclude this video.
I hope this video has been informative for you, and I look forward to see you in the next video.