ECS Containers, Task Definitions and Services
Managing Containers and Service with ECS
Last updated
Was this helpful?
Managing Containers and Service with ECS
Last updated
Was this helpful?
DuploCloud supports running containerized workloads using on both EC2 and Fargate. Using the DuploCloud Portal, you can define tasks, configure services, and manage container deployments without manually writing JSON task definitions or navigating the AWS Console. For a complete, step-by-step example of deploying an ECS Task Definition, Service, and Load Balancer, .
A Task Definition defines how your containers should run, including images, ports, CPU/memory settings, environment variables, volumes, and more.
Select the Tenant from the Tenant list box.
Navigate to Cloud Services -> ECS.
Select the Task Definition tab, click Add. The Add Task Definition-Basic Options display.
In the Name field, give the task definition a name.
Specify the Operating System/Architecture.
Specify the vCPU and Memory:
vCPUs: Specifies the number of CPU units used by the task. It can be expressed as an integer using CPU units, for example 1024, or as a string using vCPUs, for example 1 vCPU
or 1 vcpu
.
Memory: Specifies the amount of memory (in MiB) used by the task. It can be expressed as an integer using MiB, for example 1024
, or as a string using GB, for example 1GB
or 1 gb
.
Optionally, specify Volumes for the Task Definition.
Click Next. The Add Task Definition-Advanced Options display.
In the Container-1 field, specify your primary Container details.
Be sure to select the Essential Container option when defining your containers, as the task will fail if the essential container stops or fails to run.
Click Submit.
Execute a single instance of a container based on your Task Definition. This option is useful for jobs, scripts, and testing.
Select the Tenant from the Tenant list box.
Navigate to Cloud Services -> ECS.
Select the Task Definition tab
From the TASK DEFINITION FAMILY NAME list, locate the Task Definition to run. Note that this is the Task Definition Name prepended by a unique identifier, which includes your Tenant name and part of your Infrastructure name.
Click on the Actions menu, and select Execute. The Run ECS Tasks pane displays.
Select the Version and Specify the No of Tasks.
Click Create to run the task.
Deploy a long-running ECS service that manages task replication, health checks, and optional load balancing.
Select the Tenant from the Tenant list box.
Navigate to Cloud Services -> ECS.
Select the Task Definitions tab.
Select the Task Definition from the TASK DEFINITION FAMILY NAME list. Note that this is the Task Definition Name prepended by a unique identifier, which includes your Tenant name and part of your Infrastructure name.
Select the Service Details tab, and click Configure ECS Service. The Add ECS Service page displays.
In the Name field, a name for the Service.
Optionally, click Add in the LB Listeners area to add Load Balancer.
Complete the required fields on the Add Load Balancer Listener pane, and click Add.
Complete additional fields, as needed, on the Add ECS Service page.
Click Submit. The ECS Service is created.
The Task Definition details page in the DuploCloud Portal lets you manage Task Definitions, view individual versions, and inspect launched Tasks. To open the detail page, navigate to Cloud Services → ECS, select the Task Definition tab, then select the Task Definition from the TASK DEFINITION FAMILY NAME list. Note that this is the Task Definition Name prepended by a unique identifier, which includes your Tenant name and part of your Infrastructure name.
From the Task Definition details page, click Actions to access the following options:
View JSON
Displays the full configuration of the Task Definition family in JSON format.
Execute
Runs a one-off ECS Task based on this Task Definition.
Edit Task Definition
Opens the Task Definition in edit mode for changes to containers, resources, etc.
From the Task Definition details page, select the Task Definitions tab, then the menu icon (â‹®) next to any Task Definition version to access the following options:
View JSON
Shows the JSON configuration for that specific version.
Edit Task Definition
Opens the version for editing.
Console
Opens the version in the AWS ECS Console.
Delete
Deletes the version (if it is not in use).
From the Task Definition detail page, select the Tasks tab, then click the menu icon (â‹®) next to any task to access the following options:
View JSON
Displays the runtime configuration of the Task in JSON format.
Console
Opens the ECS Task in the AWS Console.
Logs
Opens the CloudWatch Logs stream for the container.
Shell Access
Launches a shell session in the container.
Select the Tenant from the Tenant list box.
Navigate to Cloud Services → ECS.
Select the Services tab.
Select the Service from the NAME column.
Click Actions to access the following options:
View JSON
View the JSON configuration for the Task Definition family.
Console
Open the Task Definition in the AWS Console.
Logs
View logs associated with the Task Definition.
Execute
Run a one-off ECS Task from this Task Definition.
Edit Task Definition
Open the Task Definition in edit mode.
Edit Service
Modify the configuration of the ECS Service.
Delete Service
Deletes the selected ECS Service.
Set up a containerized environment where ECS uses EC2 instances to host containers. By leveraging an Auto Scaling Group (ASG), ECS can automatically launch and scale EC2 instances as needed to run your containers.
Agent Platform
ECS
Image
Other
Other Image ID
ECS-Optimized AMI ID
Fargate is a technology that you can use with ECS to run containers without having to manage servers or clusters of EC2 instances.
Add additional containers by clicking the add icon ( ) to create up to five (5) containers.
with the following specifications:
following the steps shown above.
Add to the Task Definition. During ECS Service creation, click Capacity Provider and select the ASG you created in step 1.
For information about Fargate, .