{"id":18914091,"url":"https://github.com/aws-devops-projects/eks-fargate","last_synced_at":"2025-04-15T08:31:07.468Z","repository":{"id":46591722,"uuid":"287513875","full_name":"AWS-Devops-Projects/eks-fargate","owner":"AWS-Devops-Projects","description":"Start with the eksworkshop setup","archived":false,"fork":false,"pushed_at":"2020-10-16T05:25:33.000Z","size":21,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T18:50:49.176Z","etag":null,"topics":["aws-cloud9","aws-ecr","aws-ecs","aws-fargate","aws-iam","crystal","eks","kubernetes-cluster","nodejs"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AWS-Devops-Projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-14T11:08:18.000Z","updated_at":"2022-07-20T06:14:24.000Z","dependencies_parsed_at":"2022-08-23T14:30:49.321Z","dependency_job_id":null,"html_url":"https://github.com/AWS-Devops-Projects/eks-fargate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWS-Devops-Projects%2Feks-fargate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWS-Devops-Projects%2Feks-fargate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWS-Devops-Projects%2Feks-fargate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWS-Devops-Projects%2Feks-fargate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWS-Devops-Projects","download_url":"https://codeload.github.com/AWS-Devops-Projects/eks-fargate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249035411,"owners_count":21202080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cloud9","aws-ecr","aws-ecs","aws-fargate","aws-iam","crystal","eks","kubernetes-cluster","nodejs"],"created_at":"2024-11-08T10:10:00.599Z","updated_at":"2025-04-15T08:31:07.214Z","avatar_url":"https://github.com/AWS-Devops-Projects.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Start with the eksworkshop setup:\n\n\n\n- build a cloud9 instance: https://eksworkshop.com/020_prerequisites/workspace/\n- install/configure the cli tools: https://eksworkshop.com/020_prerequisites/k8stools/\n- create iam role: https://eksworkshop.com/020_prerequisites/iamrole/\n- attach the iam role to cloud9: https://eksworkshop.com/020_prerequisites/ec2instance/\n- update iam settings for cloud9: https://eksworkshop.com/020_prerequisites/workspaceiam/\n- clone the service repos: https://eksworkshop.com/020_prerequisites/clone/\n- install/configure eksctl: https://eksworkshop.com/030_eksctl/prerequisites/\n- launch eks: https://eksworkshop.com/030_eksctl/launcheks/\n- test cluster/configure environment: https://eksworkshop.com/030_eksctl/test/\n\n\n## Deploy  sample apps:\n- deploy nodejs backend: https://eksworkshop.com/beginner/050_deploy/deploynodejs/\n```\ncd ~/environment/ecsdemo-nodejs\nkubectl apply -f kubernetes/deployment.yaml\nkubectl apply -f kubernetes/service.yaml\n```\n- deploy crystal backend: https://eksworkshop.com/beginner/050_deploy/deploycrystal/\n```\ncd ~/environment/ecsdemo-crystal\nkubectl apply -f kubernetes/deployment.yaml\nkubectl apply -f kubernetes/service.yaml\n```\n- scale up the backends: https://eksworkshop.com/beginner/050_deploy/scalebackend/\n```\nkubectl scale deployment ecsdemo-nodejs --replicas=3\nkubectl scale deployment ecsdemo-crystal --replicas=3\n```\n\n## Examine current state of things:\n```\nkubectl get nodes # we see our 3 managed nodes\n```\n\n## There are currently a few limitations that you should be aware of:\n- There is a maximum of 4 vCPU and 30Gb memory per pod.\n- Currently there is no support for stateful workloads that require persistent volumes or file systems.\n- You cannot run Daemonsets, Privileged pods, or pods that use HostNetwork or HostPort.\n- The only load balancer you can use is an Application Load Balancer.\n\n## Because of that last one, we want to make sure we deploy the frontend to a different namespace:\n- edit yaml to deploy to new namespace\n### example diff:\n```\n$ git diff\ndiff --git a/kubernetes/deployment.yaml b/kubernetes/deployment.yaml\nindex 3dcd89a..aad7093 100644\n--- a/kubernetes/deployment.yaml\n+++ b/kubernetes/deployment.yaml\n@@ -4,7 +4,7 @@ metadata:\n   name: ecsdemo-frontend\n   labels:\n     app: ecsdemo-frontend\n-  namespace: default\n+  namespace: frontend\n spec:\n   replicas: 1\n   selector:\ndiff --git a/kubernetes/service.yaml b/kubernetes/service.yaml\nindex 19c7497..474acaa 100644\n--- a/kubernetes/service.yaml\n+++ b/kubernetes/service.yaml\n@@ -2,12 +2,12 @@ apiVersion: v1\n kind: Service\n metadata:\n   name: ecsdemo-frontend\n+  namespace: frontend\n```\n\n## Create a new namespace and deploy the frontend\n```\nkubectl create namespace frontend # create a new namespace for the frontend service\nkubectl apply -f ~/environment/ecsdemo-frontend/kubernetes/deployment.yaml # deploy frontend application\nkubectl apply -f ~/environment/ecsdemo-frontend/kubernetes/service.yaml # deploy frontend service\n```\n\n## Now deploy a farage profile:\n```\neksctl create fargateprofile --cluster eks-fargate-demo --namespace default\n```\n\n### example output:\n```\n[ℹ]  creating Fargate profile \"fp-2e5e699f\" on EKS cluster \"eks-fargate-demo\"\n[ℹ]  created Fargate profile \"fp-2e5e699f\" on EKS cluster \"eks-fargate-demo\"\n```\n\n## Next redeploy the backend apis:\n```\nkubectl apply -f ~/environment/ecsdemo-nodejs/kubernetes/  # this scales back to 1\nkubectl apply -f ~/environment/ecsdemo-crystal/kubernetes/ # this scales back to 1\nkubectl scale deployment ecsdemo-nodejs --replicas=3\nkubectl scale deployment ecsdemo-crystal --replicas=3\n# optionally delete the remaining pods\n```\n\n## View the deployments:\n```\nkubectl get deployments --all-namespaces\n```\n\n## View the pods:\n```\nkubectl get pods --all-namespaces -o wide | column -t | awk '{ print $2, $8 }' | column -t\n```\n\n## Examine the current state of things:\n```\nkubectl get nodes # now we see 6 additional nodes, 1 per pod, on fargate.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-devops-projects%2Feks-fargate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-devops-projects%2Feks-fargate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-devops-projects%2Feks-fargate/lists"}