Pages

Sunday, September 13, 2020

Elastic Container Service - Running Tasks and Services

Once the task definition is created along with the Container definition we now can create the task. Go to the Task Definition and click on the Actions. Click the “Run Task” in the Actions. Now it will create a task in the Ecs Cluster. The task will be run in either of the Cluster Instances in the Ecs Cluster. 
Once you click on the “Run Task”,it opens a new Wizard that allows one to choose a cluster and other details to run the task.

I will not be choosing any more values and I will keep them default. Click on the Run task button. It will take a few minutes to download the image and then run the container from that image. We can see the running tasks inside the Tasks tab in the Cluster.

Check if the Container is Running
Lets see if the container is running. Click on the tasks tab where we see the running tasks details. The details include the tasks running, the instance where the task is running etc. Click on the Task to see more details regarding the task. Check the instance where it is running and login to that instance.

Run the “docker ps” command to see if the container is running or not. We can see the container is up and running.

Running a Service
Once the task definition is created along with the Container definition we now can create the service. Go to the Task Definition and click on the Actions. Click the “Create Service” in the Actions. 
Once you click on the “create Service”,it opens a new Wizard that allows one to choose a cluster and other details to run the task.

I filled in the details as above for my application. The important thing is the Service type and number of tasks. As we discussed earlier about the service type, I have chosen the Replica type. The Number of tasks is also 1 which means at least 1 instance of the container is running all time.

The service type also includes the “Deployments” option which will provide us a way to deploy the service. The default is the “rolling Update”. We can also choose the “blue/green deployment”. Choose the option necessary for the application.

Click Next and choose the default options and create the Service.

In the next article, we will see how we can configure a load balancer to route the requests to the Containers running in the Elastic Container service.

1 comment :

  1. This is the simplest way of learning the concept of Windows Versions .Thank you so much for the article. It's such a great lesson and your explanation is greater than it.Keep it up.

    ReplyDelete