简体   繁体   中英

ECS Fargate with ALB challenges

I am currently exploring AWS ECS with Fargate. At first, I thought that it is a good feature that can do autoscaling and save cost, as well as without server maintenance overhead.

But when I look further onto it, the more I see the pain into it.

  1. Fargate does not provide static IP, and the recommendation is to use ALB. ALB alone is costing plenty of money.
  2. ALB doing health check interval and thus Fargate rarely sleeps due to ALB (and thus incurring more charges then it should)

My question is:

  1. Anyone have an alternative of dealing with issue (1) and (2)? a way that can overcome it for cost saving purposes and at the same time retaining an elastic IP
  2. If ALB is forwarded to Fargate with IP address, what happen if IP ECS (Fargate) IP got restarted? Will ALB auto detect it or what are the way to detect Fargate IP changes and update back to ALB automatically, and if not, how to handle such situation where the IP is recycled?
  1. Anyone have an alternative of dealing with issue (1) and (2)? a way that can overcome it for cost saving purposes and at the same time retaining an elastic IP

A load balancer (ALB or NLB) is really your only option. Your statement about health checks preventing Fargate from "sleep" is incorrect though. There is no "sleep" option in Fargate.

If you want something very similar, but with a sleep option, I suggest looking into AWS App Runner .

  1. If ALB is forwarded to Fargate with IP address, what happen if IP ECS (Fargate) IP got restarted? Will ALB auto detect it or what are the way to detect Fargate IP changes and update back to ALB automatically, and if not, how to handle such situation where the IP is recycled?

ECS integrates directly with the load balancer target group. You configure the ECS service what load balancer and target group you are using, and ECS will keep the load balancer's target group up-to-date with your Fargate IP address(es) automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM