首页 > 其他 > 详细

[AWS - DA] ECS, ECR, Fargate

时间:2021-06-08 10:00:13      阅读:20      评论:0      收藏:0      [点我收藏+]

ECS

Steps to create a ECS

  1. Create Cluster: EC2 Linux + Networking

When you created ECS cluster, it comes with Auto Scaling Group, and with ASG, it comes with EC2 instances.

Also created Launch Configuration.

Also create IAM rule for ECS Instance Role.

技术分享图片

 

  2. Create ECS Task Definitions

  • Tasks definitions are metadata in JSON form to tell ECS how to run a Docker Container.
  • Contains crucial information around:
    • Image Name
    • Port Binding for Container and Host
    • Memory and CPU required
    • Environment variables
    • Networking information
  • Task Role: If doesn‘t come with Task Role, you cannot pull the image from ECR, cannot talk to EC2... It can be created automaticlly
  • Container defination技术分享图片

  "httpd:2.4": image + tag: ECR knows it comes from Docker Hub

  • Port Mapping
    • Can be static mapping
    • Or dynamic mapping with ALB (set Host port to 0)

技术分享图片

  3. Create ECS Service

  • Will run Task defination
  • We can set tup Application Load Balancer

技术分享图片 

技术分享图片

技术分享图片

技术分享图片

It use Dynamic port mapping, for Host Port, we can set 0.

技术分享图片

 

ECR

技术分享图片

Ref to ECR in Task defintion:

技术分享图片

Fargate

  • Create Cluster with Fargate
  • Create Task Defination
  • Create Service

技术分享图片

  • ECS need to use IAM role which attached to EC2 level to perform different action.
  • Task Defination need to have ECS Task Role to perform acess different resource.

 

技术分享图片

  • When you add a new container, ECS service need to find out which EC2 instances to put new containers
  • When remove EC2 isntance, need to find out which one to terminated

 

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

 

技术分享图片

 

技术分享图片

技术分享图片

Cluster Capacity Provider can decide new Task should run on new EC2 instance or Fargate.

 

技术分享图片

技术分享图片

技术分享图片

 


 

技术分享图片

技术分享图片

技术分享图片

技术分享图片


 

 

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

[AWS - DA] ECS, ECR, Fargate

原文:https://www.cnblogs.com/Answer1215/p/14859210.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!