A tutorial on using EKS, ECS with fargate, or AWS App Ruuner on the AWS Cloud
- setup app: virtualenv +
make all
- test app local:
python app.py
- curl it to test:
curl localhost:8080/change/1/34
- create ECR Repo
- build container
- push container
- run docker local:
docker run -p 8080:8080 changemachine
- deploy to fargate
- test public service
- Install
kubectl
andeksctl
. You can follow instructions here. - Open up either AWS CloudShell or AWS Cloud9
- Create a cluster at the terminal
eksctl create cluster --name FargateExploration --region us-east-2 --fargate
(Takes a few minutes)
You will see output similar to this
2021-02-17 17:52:07 [ℹ] waiting for CloudFormation stack "eksctl-FargateExploration-cluster"
2021-02-17 17:52:28 [ℹ] creating Fargate profile "fp-default" on EKS cluster "FargateExploration"
-
Verify the cluster:
aws eks describe-cluster --name FargateExploration --query cluster.resourcesVpcConfig.clusterSecurityGroupId
(or leave off the query and get entire description) -
Create ECR Repo:
- ECS is much easier to setup with Fargate: https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun
This repository can easily be converted to an AWS Runner Method in Wizard to the following:
- For build do:
pip install -r requirements.txt
- To run:
python app.py
- For port:
8080