项目作者: enghwa

项目描述 :
one node Amazon ECS cluster using EC2 Spot instance and haproxy
高级语言: TypeScript
项目地址: git://github.com/enghwa/OneNodeEcs.git
创建时间: 2019-10-30T16:32:30Z
项目社区:https://github.com/enghwa/OneNodeEcs

开源协议:Apache License 2.0

下载


One node ECS cluster using Spot Instance

This will deploy a single node ECS with t3a.micro, in us-east-2 (Ohio), this will give you ~USD $2 for 2vcpu/1Gib.
ECS Tasks will use AWS Cloud Map for service discovery while Ha Proxy provides the load balancing.

Architecture diagram

Install

  1. git clone https://github.com/enghwa/OneNodeEcs.git
  2. cd OneNodeEcs
  3. npm install
  4. export AWS_DEFAULT_REGION=us-east-2 # or any of your favourite region, but take note if the t3a.micro spot price
  5. npx cdk@1.22.0 bootstrap
  6. npx cdk@1.22.0 deploy

Once all the resources are deploy (monitor this using AWS Cloudformation dashboard), you can use your browser to test:

  1. http://<public IP of EC2>/ --> nyant cat
  2. http://<public IP of EC2>/nginx --> load balanced 2 nginx tasks

Remove

  1. npx cdk@1.22.0 destroy