ECS Task Driver
Name: nomad-driver-ecs
Homepage: https://github.com/hashicorp/nomad-driver-ecs
Note: The ECS Task Driver is an example Remote Task Driver and not intended for production use.
The ECS task driver plugin for Nomad allows running AWS ECS tasks via Nomad. Allocations for these jobs are scheduled onto Nomad clients like traditional task drivers, however the actual task is executed remotely in AWS ECS. The Nomad client agent manages the remote ECS task like any other local Nomad task: restarting it if it fails, stopping it when requested, etc.
When a Nomad node assigned allocations with ECS tasks is drained, the ECS tasks are not stopped. Instead the replacement allocations reconnect to the original ECS tasks to avoid unnecessary downtime.
If a Nomad node assigned allocations with ECS tasks crashes and is considered
down
, the replacement allocations for the lost
allocations reconnect to the
original ECS tasks to avoid unnecessary downtime. If the original crashed Nomad
node restarts, it will detect lost
allocations and stop monitoring them since
a new node has taken over.
Client Requirements
The AWS ECS Task Driver is not currently built into Nomad and must be downloaded onto the client host in the configured plugin directory.
Plugin Options
Once the plugin binary is installed, the plugin must be configured in your Nomad client agent's HCL:
cluster
- The AWS ECS cluster to run tasks in.region
- The AWS region to run tasks in.
Task Configuration
Nomad ECS tasks must first be defined for the ECS cluster. See the Nomad ECS driver demo task for an example ECS task provisioned by Terraform.
Once the ECS task is provisioned, Nomad may run it via a job:
config.task
block defines the configuration of the ECS task:launch_type
- The launch type on which to run your task.task_definition
- The family and revision (family:revision
) or full ARN of the task definition to run.network_configuration
- The network configuration for the task (egawsvpc
forFARGATE
tasks).aws_vpc_configuration
- The VPC subnets and security groups associated with a task.assign_public_ip
- Whether the task's elastic network interface receives a public IP address.security_groups
- The security groups associated with the task or service.subnets
- The subnets associated with the task or service.