ECS Containers, Task Definitions and Services

Managing Containers and Service with ECS

Creating a Task Definition

  1. Select the Tenant from the Tenant list box.

  2. Navigate to Cloud Services -> ECS.

  3. Select the Task Definition tab, click Add. The Add Task Definition-Basic Options display.

The Add Task Definition-Basic Options page
  1. In the Name field, give the task definition a name.

  2. Optionally, specify the Operating System/Architecture.

  3. Optionally, update 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.

  4. Optionally, specify Volumes for the task definition.

  5. Click Next. The Add Task Definition-Advanced Options display.

    The Add Task Definition-Advanced Options
  6. In the Container-1 field, specify your primary Container details.

    • Add additional containers by clicking the add icon ( ) to create up to five (5) containers. Use the and icons to collapse and expand the Container areas as needed. Delete a container by clicking the Delete ( X ) icon in a container area.

    • 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.

  7. Click Submit.

Creating an ECS Service

  1. Select the Tenant from the Tenant list box.

  2. Navigate to Cloud Services -> ECS.

  3. In the Task Definitions tab, select the correct Task Definition Family Name. This is the Task Definition Name prepended by a unique identifier, which includes your Tenant name and part of your Infrastructure name.

  4. Select the Service Details tab, and click Configure ECS Service. The Add ECS Service page displays.

The Add ECS Service page
  1. In the Name field, a name for the Service.

  2. 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.

  3. Complete additional fields, as needed, on the Add ECS Service page.

  4. Click Submit. The ECS Service is created.

Managing ECS Services

  1. Select the Tenant from the Tenant list box.

  2. Navigate to Cloud Services -> ECS.

  3. Select the Services tab.

  4. Select the Service from the NAME column. Service details display.

  5. Select the Actions menu for additional options, including Edit or Delete.

Actions menu for ECS Service

Kubernetes Containers

You can display and manage the Containers you have defined in the DuploCloud portal. Navigate to Kubernetes -> Containers.

Use the Options Menu ( ) in each Container row to display Logs, State, Container Shell, Host Shell, and Delete options.

Option
Functionality

Logs

Displays container logs.

State

Displays container state configuration, in YAML code, in a separate window.

Container Shell

Accesses the Container Shell. To access the Container Shell option, you must first set up Shell access for Docker.

Host Shell

Accesses the Host Shell.

Delete

Deletes the container.

Containers tab displaying defined containers with highlighted Options Menu

Editing containers for ECS Services

To edit the created Task Definition in order to add or delete multiple containers, select the Task Definition in the Task Definitions tab, and from the Actions menu, select Edit Task Definition.

Configuring ECS with EC2 Capacity Provider

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.

  1. Create an ASG with the following specifications:

    • In the Agent Platform field, select ECS.

    • In the Image field, select Other.

    • In the Other Image ID field, enter the ECS-Optimized AMI ID.

  2. Create a Task Definition following the steps shown above.

  3. Add an ECS Service to the Task Definition you created in step 2 using the following specifications:

    • Click the Capacity Provider button

    • In the Capacity Provider list box, select the Auto Scaling Group (ASG) you created in step 1.

Elastic Container Service (ECS) Fargate

Fargate is a technology that you can use with ECS to run containers without having to manage servers or clusters of EC2 instances.

For information about Fargate, contact the DuploCloud support team.

Last updated

Was this helpful?