Hey, everyone.
And welcome back.
Now, in today's video, we'll be discussing about the components of ICS.
Now, at a high level overview, when we discuss about the X cluster, there are three primary components
that are involved.
First one is the task definition.
Second one is the task, and third one is the services.
Once you understand all three of this, you will be able to manage the X cluster much more easily.
The first important component is the task definition.
At a high level overview.
Task definition is nothing, but it contains information related to the container image from which image
you want to launch the application from.
It can be engine X, it can be Apache, it can be your custom application and so on.
Along with this, it can also contain information related to port mapping.
Your application is running on which port, whether it is 88, 83, 306 and others along with other
information like storage for the containers and so on.
All right.
So at a high level overview task definition is a text file that describes one or more containers that
form to be your application.
This is one important part.
Now, let me quickly show you your now, I already have a cluster that is configured now within your
I have a task definition and there are two task definition one for the Apache web server application.
Second for the engine X web server application.
If I open up one of the task definition over here, let's look into one of this.
So within here you have information related to the CPU and the memory consumption associated with it.
You have information related to the image from which the engine X application should be launched.
It contains information related to the storage.
And if you look into the JSON over here, as we discussing in the first point, task definition is a
text file that describes one or more containers that forms to be your application.
Now if you look into the JSON over here, it contains the image, you see it is engine X latest and
all of the necessary details required to configure your application is what you define at that task
definition level.
All right.
So before you deploy your application through the x cluster, first step is to create a task definition.
The second important component is a task.
A task is the instantiation of the task definition within the cluster.
For example, let's say you have created a task definition based on Engine X image.
Now this task definition by itself will not do anything in production.
You want the application to run in the EC2 instance or the servers.
So what do you do?
You go ahead and create a task.
So in the second point, it is clearly mentioned that after you have created a task definition for your
application, you can specify the number of tasks to run on your cluster.
For example, you have two task over here.
If there are multiple servers, you can run ten task as well.
That can load balance the overall traffic that your website receives.
So this is the second part.
The third important component is service.
At a high level overview service allows us to run and maintain the desired number of tasks simultaneously
in the x cluster.
For example, you see in the diagram you have a service.
Service also uses the task definition and based on the task definition, you can define at a service
level how many task you want.
One of the benefits of services that if any of your task fail or stops for a certain reason, service
can go ahead and launch new task.
For example, let's say Task one has failed due to some reason you do not really know.
So service can go ahead and create one more task for you.
You do not really have to do anything manually, so let's go ahead and quickly look into it from demo
perspective.
So let's go back to our cluster here.
Within year, you can go ahead and you can deploy a service.
Let me quickly deploy a service.
Now, again, note that this is a demo video we are not expected to start practical from scratch.
Main aim is to understand about this concept at a high level overview.
Now let me go ahead and deploy a new service to our easy to instance that we have as part of the ICS
cluster.
Now, within the deployment configuration over here, you have a service and you have a task.
Ultimately, service is nothing, but it launches and manages the task for you.
So we'll be making use of service.
And here you have two task definition Apache task definition and engine is task definition.
I'll be using the engine X task definition over here, the service name, let's just call it as engine
X, and within you see, you have desired task how many tasks you want.
So I'll just select it as one and then you can go ahead and click on deploy.
So if I refresh this, you'll see it is going ahead and it is deploying and within it it states zero
out of one task.
Let's refresh this.
And now you see it is stating one out of one task.
Now, as we were discussing in the component of service is that if any of your task fail or stop for
any reason, X Service Scheduler launches another instance based on your task definition.
So let's go ahead and also test it out.
So currently in the easy two instance where the task is running, if I do a Docker piece, you see that
we have one container that is currently running based on the engine X image.
So let's go ahead and manually terminate the container and see what is the effect that can be seen.
So I'll say Docker, stop.
I'll specify the name.
If I do a piece here, you see, our engine X task is now stopped and we only have the container agent
of X.
Now, let me clear the screen.
If I do a Docker piece one more time, you'll see our engine X based container has started once more.
And now, if you'll also explore the service here, let me quickly show you within here you will get
information related to the CPU as well as the memory utilization within here in that task.
Here you see that there is one task that is stopped.
So this is something that we had manually stopped doing here.
As soon as we stopped it, X started one more task based on the engine X task definition.
Great.
So I hope at this at a high level overview, you understood the components of X and with this will conclude
today's video.