https://github.com/noahgift/eks-fargate-tutorial
A tutorial on using EKS with fargate on the AWS Cloud
https://github.com/noahgift/eks-fargate-tutorial
Last synced: 2 months ago
JSON representation
A tutorial on using EKS with fargate on the AWS Cloud
- Host: GitHub
- URL: https://github.com/noahgift/eks-fargate-tutorial
- Owner: noahgift
- License: cc0-1.0
- Created: 2021-02-17T17:41:24.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-23T21:23:17.000Z (over 4 years ago)
- Last Synced: 2025-04-08T14:39:32.135Z (6 months ago)
- Language: Python
- Size: 20.5 KB
- Stars: 10
- Watchers: 2
- Forks: 30
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ecs and eks fargate-tutorial or AWS App Runner
A tutorial on using EKS, ECS with fargate, or AWS App Ruuner on the AWS Cloud### Verified Deploy with AWS App Runner
### ECS method
* 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### EKS method
## Build a Fargate App
* Install `kubectl` and `eksctl`. You can [follow instructions here](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html).
* 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
```bash
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
### AWS App Runner method
This repository can easily be converted to an AWS Runner Method in Wizard to the following:
1. For build do: `pip install -r requirements.txt`
2. To run: `python app.py`
3. For port: `8080`

### References
* [Fargate-AWS](https://aws.amazon.com/getting-started/hands-on/build-modern-app-fargate-lambda-dynamodb-python/module-two/)
* [Python-Fargate-AWS](https://github.com/aws-samples/aws-modern-application-workshop/tree/python/module-2)