Giter Club home page Giter Club logo

amazon-eks-cicd-codebuild's Introduction

CI/CD (CodeCommit, CodeBuild, CodePipeline) with EKS/ECS-EC2/ECS-Fargate as backend implemented with Amazon CDK

This project is a rough version, will keep enriching.

Usage

EKS as Backend

  • Refer to README_eks.md
  • Notice: CodeDeploy and deploy stage of CodePipeline don’t support EKS yet.
  • After deploy, it's needed to push code to CodeCommit and manually adjust buildspec.yaml to have the EKS resources successfully created, to be fixed.
  • When destroy with new VPC created earlier, kubectl delete svc/flask-svc deploy/flask or manually delete load balancer, then cdk destroy.

ECS-EC2 as Backend Setup:

  • Specify the stack to create in the cdk/bin/cdk.ts file
  • npm run build
  • cdk deploy
  • Manually push code to CodeCommit repo and pipeline will be triggered Destroy:
  • cdk destroy

ECS-Fargate as Backend Setup:

  • Specify the stack to create in the cdk/bin/cdk.ts file
  • npm run build
  • cdk deploy
  • Manually push code to CodeCommit repo and pipeline will be triggered Destroy:
  • cdk destroy

ECS-Fargate as Backend enriched version 1.0: with CloudFormation to Deploy in the Pipeline Setup:

  • Specify the stack to create in the cdk/bin/cdk.ts file
  • npm run build
  • cdk deploy ClusterStack
  • cdk deploy CodePipelineStack, AppServiceDeployStack will be deployed as nested stack
  • Manually push code to CodeCommit repo and pipeline will be triggered Destroy:
  • cdk destroy AppServiceDeployStack, if AppServiceDeployStack is not destroyed fiest, it will fail,then grant permissions to the stack role and delete the stack.
  • cdk destroy CodePipelineStack
  • cdk destroy ClusterStack

TODO:

  • Split pipeline into dev, uat, prod
  • Support Blue/Green deploy, for references mageDetail.json File for Amazon ECS Blue/Green Deployment Actions, Amazon ECS Blue/Green Deployment
  • Grant limited but enough permissions to service Role
  • Expose moren configurations of the entire infrastructure
  • Support Github repo, use Secrets Manager to store Github Credentials
  • Support existed ECR repo, EKS/ECS cluster (eks.Cluster.fromClusterAttributes()), Code repo
  • Evaluate using cdk lib( @aws-cdk/aws-eks) to manage EKS resources instead of kubectl cli, but then it might be not as convenient as managing k8s yaml, also parameters passing
  • Support monitoring, auto-scaling EKS/ECS cluster (metrics-server), logging
  • For Eks, LB, ECR repo, S3 resources need to be manually deleted; For ECS, ECR repo; S3 resources need to be manually deleted.
  • Prepare a flask app with DB connection more close to real case.
  • Use AWS SSM parameter to store configurations of CDK stack, even DB configurations.
  • Clean up the original code/Readme a little bit.
  • Refactor the project into support choosing modules(Repo: CodeCommit and Github; CD backend: EKS, ECS-Fargate, ECS-EC2 etc.)
  • Create a frontend UI console for easy use.

amazon-eks-cicd-codebuild's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.