Hey Edwin, and welcome to the practical video associated with X.
Now, if you have understood the basic components of X like task definition services and task, then
the overall configuration related to the X cluster would be very straightforward.
So with this base set, let's go ahead and quickly get started.
Now, currently I'm in the console.
Let's quickly switch to the X service.
Now, at this stage there is an older console that you will see, but this is something that will be
replaced.
So let's quickly jump to the new X experience here.
At a later stage, you will not really have to select this checkbox.
The newer X experience will be the default one.
Now, as we're discussing, one of the first things that we'll have to create is the x cluster.
Once the x cluster is created, then we can go ahead and create task definition services, etc..
So let's quickly go ahead and create the X cluster.
So let's just call it as demo x cluster.
We'll leave the VPC and everything to be default in the infrastructure.
The target one is selected by default.
We'll be selecting the Amazon EC2 instance.
As soon as you select it, it is asking you to create a new auto scaling group.
So first, let's go ahead and choose the operating system.
We'll be using the Amazon Linux to the EC two instance type, let's say DT two micro.
You can select the keypad or even if there are no keypad in the region, that is completely fine.
Now in the desired capacity of the auto scaling, let's say minimum as one and maximum as three.
So minimum there will be one easy to instance that will be launched to begin with.
So this is the basics.
Let's go ahead and quickly create the ex cluster grid.
So our cluster creation is in progress till the time the cluster gets created.
Let's switch to the task definition and let's create a new task definition here.
The name, let's say demo task definition.
And within here you'll have to specify the details related to what are the container images that you'd
like.
We'll be using a sample engine X container image, so I'll just say engine X latest in case if you have
some custom image of your application, you can use it over here.
I'll be using the engine X image.
Once this is done, let's quickly go a bit down.
We'll click on next.
Within the application environment will not be selecting.
Target will be using the simple approach of using the EC2 instance here and now.
You'll have to specify things like the operating system, architecture, the CPU and memory related
details that should be reserved for your task.
Now note that the EC two instance that will be created as part of our SC cluster is based on RT two
micro.
So if you give one V CPU and three GB of memory, this will fail.
Since the RT two micro does not really have that much amount of memory.
So CPU let me just say 0.25 and memory.
I'll say 0.5 GB.
All right.
The basic one that fits the instance once, then we'll be leaving these as default.
Let's go a bit down.
Let's click on next.
This is a review screen.
Once you have selected it, you can click on Create Grid.
So our task definition has been successfully created.
Let's go back to the X and this is where our cluster is currently running.
Now, one thing that you will see is that in this cluster there is nothing that is deployed.
So what we can do, we can go ahead and deploy a new service.
Let's go ahead and do a deployment here within here.
Let's select the launch type of EC two.
We'll go a bit down within the application type.
You can select task or service.
We'll stick with service within the family.
I'll specify the demo task definition that we have created and you can give it a name, I'll just call
it as Engine X service.
And within here you have two options.
I'll select the desired task as one.
That is completely fine.
You can also select various things like load balancing and others.
We'll keep it simple.
As of now, we'll go ahead and we'll do a deploy.
Now, within here, if I quickly refresh at this stage, it is trying to deploy the new task based on
the engine X image.
Let's refresh the page.
And now you see the task deployment has been completed successfully.
Now, at this stage, just verify the security group.
If you look into the security group, the Port eight is allowed from 0000.
Now, at this stage, the engine X container should be running inside the EC two instance.
In fact, let me also quickly show you this so that there is no confusion in the inbound rule.
Just for simplicity, let me just add the SSH inbound rule here from everyone.
Now let's switch to instances.
Let me copy the public IP of the instance.
Now again, I'm just using the SSH to connect so that I can show you that the engine x container is
running from my terminal.
Let me quickly connect to the EC two instance and grid.
We are connected.
Now within here, if I do a Docker piece, you should see that we have the engine X based container
that is up and running.
Great.
So I hope with this at a high level overview, you understood the basics of X.
Now one important thing to note is that successfully deployment of a task in the EC two does not really
mean it is working.
For example, let me copy the public IP and let me add the IP address in the browser.
You see, there is no engine ICS page that is loading.
Now again, before you do that, make sure that your security group allows Port eight over here.
All right.
So even though our engine X container is deployed, it is still not working.
So this is where things needs to be modified.
So let's quickly go back to our X console.
Let's go to the task definition.
We had the task definition over here.
Let's quickly create a new revision.
This time we'll be doing the mapping.
So host port would be eight.
So engine x is running on the port of 80 and this will be mapped to the host port of 80.
Once you have selected this, everything will remain to be same.
I'll quickly do a create.
Now, again, when you're working with a container orchestrator tool, maybe x or x, your basic understanding
related to Docker is important.
For example, you should know what exactly the port mapping and all of these things mean.
These are fundamental to Docker.
All right.
So once we have this revision number two associated with the newer task definition, let's go back to
the cluster.
Will select the service.
Let's quickly do a delete.
And I'll just type delete here.
All right.
Once this is then let's quickly deploy one more service over here based on EC2 instance.
Will select our task definition.
This time it will use the revision number two and let's just call it as engine X service two.
All right.
Once this is done, let's go ahead and deploy.
So let's refresh the page here and you'll see our new service is created.
Now, if I refresh the page here, you should see the basic welcome to Engine X page grid.
So I hope with this now you understood the basics of X in a much more better terms and with this will
conclude today's video.