Thursday, 15 February 2018

AWS ECS(Task)


Task
  • Instanciated task definiton
  • Running docker instances (containers) specified in definition
    • One ore more containers on tsk
  • Entire task is run on a single Container Instance
  • Two tasks (from the same definition) may run on different container instances 

Task Definition
  • JSON representation of a docker run CMD
  • Required to run Docker container
  • Grouping of related containers that run together e.g.
    • container: wordpress (PHP)
    • container: mysql
  • Each container in the group lands on the same instance
  • If you use the same name ECS versions it and always uses the latest
  • Must be registered with ECS

Task Definition (structure)
  • Family
    • Name of the task definiton - can have revisions
  • Container Definitions
    • basic
      • name - can be used is links section
      • image - url to repository
      • memory  - at least 4MiB
      • port mappings - bridge container host port with container port
        • hostPort -> containerPort
        • protocol 
    • advanced
      • cpu - sharing CPU
      • essential - should failed container terminate the whole task
      • links - allows 2 containers to communicate without port mappings
      • ...
  • Volumes
    • Data volumes to be attached to container
    • Volumes are associated with container instance
    • Use cases
      • persistence (container disks are ephemeral)
      • Sharing scratch area


No comments:

Post a Comment