Setup Devops in AWS

  • To set up and environment in CICD in In AWS, we require Following components
    • Application load balancer(ALB)
      • We create Different of ALB’s for frontend and backend Services.
    • For all the services(ECS) and ALB, we have only one security group.
  • Developers push their code on Code repository Like GitHub.
  • Each micro service has a docker file In its root directory, which is used to create a customised image Of that micro service Which is deployable and executable in All docker supported Environments.
  • We create a package, build an image using AWS code build Which reads instruction form a file In root directory Called as buildspec.yml.
  • We deploy image in ECS clusters using Pipeline.
  • We can define the CFT file of our ECS clusters, target service and cloud watch log groups.
    • We have details about the container, the taskdefinition, file, and details about services.
    • Under the ECS cluster, we have services under the services we have tasks.
      • The task is the image, deployed and container running the same.
    • Under the resources section, we have all the details related to the resources discussed above.
  • We require CFT’s For following other components which can be stored in S3 and letter, their path can be provided during resource formation from cloud formation.
    • Application load balancer
    • Pipeline of each service
    • The service which we have under ECS cluster.
  • When a developer pushes the code to GitHub The code build gets triggered Automatically and code Pipeline will then deploy that into ECS cluster.
    • Code build, pushes the image built to Jfrog repository.
    • Code pipeline Will take latest changes from jfrog repository And will deploy to ECS clusters.
  • Under the ECS clusters, we have services under the services we have tasks.
  • We need to create images for each environment.
  • We define Jfrog image location in service CFT
  • We have a CFT for code build, where we provide information like VPC configuration, subnets, And the environment like Linux, Windows, JVM, et cetera.
    • Source will have source of our code.
    • Trigger will have information regarding How build will trigger I.e. Which event like, push or pull request merged Et cetera.
    • Pattern will have information like on which branch when the code is deployed, the build should run.
  • We can define a separate file for CFT template parameters, which may change on basis of an environment or build.
  • In buildspec.yml We define values like variables, secrets Manager Variables, different phases etc.
    • We build the image.
    • We tag the image.
    • We push to Jfrog repository.
  • We should give port details of service to security group else we will get Unhealthy target.
  • In our load balancer, we should define rules that properly map context, Path and their forwarding to targets.
  • Tasks to be performed while creating devops from scratch.
    • Create multiple EC2 Instances based upon requirements from the application team.
    • Creation of IAM roles, policies, user groups, and cross account set up.
    • Creation of S3 buckets, policies for the application teams
    • Enable infrastructure creation using cloud formation templates.
  • AWS components AND methods mostly used
    • EC2, IAM, S3, code build, code commit, code deploy,code Pipeline, Cloud trail, cloud watch, ECS, ELB, AUTO SCALING, CLOUD FORMATION.
    • Kubernetes, Cluster creation, Master and worker nodes setup, replication enabling

Comments

Popular posts from this blog

Setup Flyway,Postgres in Jenkins using Docker

Docker

Jenkins