ECS - seanremenyi/Notes_aws_developer GitHub Wiki
What are they: imilar to a virtual machine, more like a virtual operating environment Standardized: A standarized unit with unit with everything the software needs to run e.g. libraries, system tools, code and runtime Microservices: Applications are created using independent stateless components or microservices running in containers Docker or Windows Containers: Use docker to create linux containers and windows containers for windows workloads
Architecutre of a conainer: code, liraries, virtual kernel (all three in a container) that then run on docker advantages: Highly scalable: If the pplication becomes over loaded, scale on the services you need to Fault tolerant: a single error in one of your own containers shouldn't bring down your entire app Easy to maintain: Easier to maintain, update than large monolithic applications
Wehere does ecs fit? A container orchestration service which suppports docker and windows containers Quickly deploy and scale containerized workloads without having to install, configure, manage and scale your own orchestration platform Similar to kubernetes, but with deep integration with AWS services e.g. IAM, VPC, Route53
fargate or ec2? ECS: Clusters of virtual machines: ECS will run your containers on clusters of virtual machines Fargate for serverless: Use fargate for serverless containers and you don't need to worry about the underlying EC2 instances. EC2 for more control: If you want to control the installation, configuration and management of your compute environment.
ECR: elastic container registry This is where you can store your container images. Docker or windows container AWS services that use ECS sagemaker, amazon lex, amazon.com
containers: virtual operating environment with everything the software needs to run includes libraries, system tools, code and runtime Allows applications to be built using independent stateless components or microservices running in multipple containers
Docker commands to build, tag (apply an alias and push your docker image to the ecr repository Build: docker build -t myimagerepo Tag (apply alias): docker tag myimagerepo:latest 72530006743.dkr.ecr.eu-central-a.amazonaws.com/myimagerepo:latest push image to registry: docker push 72530006743.dkr.ecr.eu-centra-1.amazonaws.com/myimagerepo:latest
buildspec.yml File:; Use buildspec.yml to define the build commands and settings used by codebuild to run your build Override buildspec.yml Settings: You can override the settings in buildspec.yml by adding your own commands in the console when you launch the build Trouble shooting Failures: If your build fails, check the build logs in the CodeBuild concole, and you can also view the full Codebuild log in Cloudwatch
Deploying docker with elastic beanstalk:
Elastic beanstalk supports the deployment of docker containers Docker containers are self-contained and include all the conifguration information and software your web application requires to run - think libraries, system tools, code and runtime Elastic Beanstalk handles the capacity provisioning, load balancing scaling, and application health monitoring Deploy:
Single docker container: You can either run a single docker container on an ec2 instance provisioned by elastic beanstalk Deploy your code: Upload a zip file containing your code bundle and elastic beanstalk will do the rest Multiple Docker containers: Use elastic beanstalk to build ecs cluster and deploy multiple docker containers on each instance Upgrade your code: If you want to upgrade your application to a new version, it's one easy step in the console to upload and deploy Code can be uploaded directly from your local machine or public s3 bucket You can also store your code in codeCommit - but must use the elastic beanstalk cli