SlideShare ist ein Scribd-Unternehmen logo
1 von 72
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
P U B L I C S E C T O R
S U M M I T
Breakingthe Monolith - Best Practices to
RunYourContainersin theCloud
Sébastien Stormacq
Technical Evangelist, AWS
@sebsto
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The12 factorapplication
I. Codebase
One codebase w/ revision control, many deploys
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Fast startup and graceful shutdown
X. Dev/prod parity
Keep environments as similar as possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as one-off processes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Youknowwhat’sgreatfora12 factorapp?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RUNNINGASINGLECONTAINER
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EC2 Instance
TaskTask
Task Task
EC2 Instance
TaskTask
Task Task
EC2 Instance
TaskTask
Task Task
EC2 Instance
TaskTask
Task Task
EC2 Instance
TaskTask
Task Task
RUNNINGCONTAINERS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RUNNINGCONTAINERSATSCALEWITHECS
Availability Zone #1 Availability Zone #2 Availability Zone #3
Scheduling and Orchestration
Cluster Manager Placement Engine
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS
AMI
Docker
agent
ECS
agent
ECSTaskECSTask
ECSTaskECSTask
EC2 Instance
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
Scheduling and Orchestration
Cluster Manager Placement Engine
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“Just launch 10 copies of
my container distributed
across three availability
zones and connect them to
this load balancer”
X 10
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
One codebase tracked in revision control, many deploys
DeployedVersionCode Version Control
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Staging / QA
Production
Dev #1
Dev #2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Explicitly declare and isolate dependencies
Dependencies
Binaries
Code
Application
Bundle
DependencyDeclaration:Node.js
package.json
npm install
# - or -
yarn install
DependencyDeclaration:Python
requirements.txt
pip install
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dependencies
Dependencies
Binaries
Code
DependencyDeclaration& Isolation: Docker
Dockerfile
docker build
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Store config in the environment
Development
Configuration
Production
Configuration
Development
Production
Development
Production
Same container deployed to both environments.
Configuration is part of the environment on the host.
Atruntimethecontainergetsconfigfromthe
environment.
Application code pulls from the environment
Environment is customized when docker runs a container
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSSecretsManager&TaskDefinitions
"containerDefinitions": [
{ "secrets": [
{ "name": "environment_variable_name",
"valueFrom": ”arn_of_your_secret"
}
]
}
]
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Treat backing services as attached resources
PostgreSQLapp1
Host
app2 3rd party service
Treat local services just like remote third party ones
PostgreSQLapp1
app2
Load balancer
Use CNAMES for maximum flexibility and
easy reconfiguration
postgres.mycompany.com
app2.mycompany.com
Easily create and maintain custom maps of your applications
Before
Version 2
After
Version 2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Strictly separate build and run stages
Build
Dependencies
Binaries
Code
Release
Config ReleaseBuild Artifact
+ =
Tagged image stored in ECR
Amazon ElasticContainerService
Config
Run
Task Definition Release v1
Task Definition Release v2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSappspec
version: 1.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
- TaskDefinition: "my_task_definition:8"
LoadBalancerInfos:
- ContainerName: "SampleApp"
ContainerPort: 80
Hooks:
- BeforeInstall: "LambdaFunctionToExecuteAnythingBeforeNewRevisionInstalltion"
- AfterInstall: "LambdaFunctionToExecuteAnythingAfterNewRevisionInstallation"
- AfterAllowTestTraffic: "LambdaFunctionToValidateAfterTestTrafficShift"
- BeforeAllowTraffic: "LambdaFunctionToValidateBeforeTrafficShift"
- AfterAllowTraffic: "LambdaFunctionToValidateAfterTrafficShift"
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
100%
Prod
traffic
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
Target group
2
100%
Prod
traffic
Test traffic listener
(port 9000)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
Green tasks:
v2 code
100%
Prod
traffic
Provision green tasks
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
100%
Test
traffic
100%
Prod
traffic
Run hook against test endpoint before green tasks receive prod traffic
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
100%
Prod
traffic
Flip traffic to green tasks, rollback in case of alarm
0% Prod
traffic
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy-ECSblue-greendeployment
100%
Prod
traffic
Drain blue tasks
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
• Docker tags are resolved when each container starts, not just during
deployments
• Deploying “latest” or “prod” can result in untested code in production
after a scale-out event
• Use unique “immutable” tags for deployments
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Build pushes new “latest” image
Image: sha256@22222... (“latest”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Service scales up, launching new tasks
Image: sha256@22222... (“latest”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Deploy using immutable tags
{
"name": "sample-app",
"image": "amazon/amazon-ecs-
sample@sha256:3e39d933b1d948c92309bb583b5a1f3d28f0119e1551ca1fe538ba414a41af48d"
}
{
"name": "sample-app",
"image": "amazon/amazon-ecs-sample:build-b2085490-359f-4eaf-8970-6d1e26c354f0"
}
SHA256 Digest
Build ID
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Compute immutable tags during build
SHA256 Digest
export IMAGE_URI=`docker inspect --format='{{index .RepoDigests 0}}'
my_image:$IMAGE_TAG
Example Result:
amazon/amazon-ecs-sample@sha256:3e39d933b...
Build ID
export IMAGE_TAG=build-`echo $CODEBUILD_BUILD_ID | awk –F":" ‘{print $2}'`
Example Result:
build-b2085490-359f-4eaf-8970-6d1e26c354f0
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Build pushes new image tagged with new build ID
Image: sha256@22222... (“build-22222”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Service scales up, launching new tasks
Image: sha256@22222... (“build-22222”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerimagetaggingfordeployments
Image: “build-22222” tag
Deployment updates service’s task definition, replacing tasks
Image: sha256@22222... (“build-22222”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Execute the app as one or more stateless processes
Stateful container stores state in local disk or local memory.
Workload ends up tied to a specific host that has state data.
eu-west-1b
Container 1
Disk
eu-west-1ceu-west-1a
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Statefuldata
Use services:
• Amazon RDS
• Amazon DynamoDB
• Amazon ElasticCache
• Amazon ElasticSearch
• Amazon S3
• ……
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Export services via port binding
Port 32456
Port 32457
Port 32458
Port 32768
Port 33487
Port 32192
Port 32794
Port 32781
Match: /api/users*
Match: /api/auth*
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Keep development, staging, and production as similar as possible
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dev #1
Dev #2
Staging / QA
Production
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Staging / QA
Production
Dev #1
Dev #2
Local Application Remote
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Model containerenvironmentswithAWS
Cloud DevelopmentKit(CDK)
Developer
Preview
• Open source framework to define cloud
infrastructure in TypeScript, Java, C#, …
• Provides library of higher-level resource types
(“construct” classes) that have AWS best practices
built in by default, packaged as npm modules
• Provisions resources with CloudFormation
• Supports all CloudFormation resource types
AWS
CDK
https://awslabs.github.io/aws-cdk
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDKtemplate
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
CDKtemplate
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDKtemplate
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
class BonjourFargate extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
new ecs.LoadBalancedFargateService(
this, "FargateService", {
cluster,
image: ecs.DockerHub.image("amazon/amazon-ecs-sample"),
});
}
}
const app = new cdk.App();
new BonjourFargate(app, 'Bonjour');
app.run();
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Treat logs as event streams
Docker connects container’s stdout to a log driver
Containerized code writes to stdout
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CLOUDWATCHLOGSCONFIGURATION
{
"containerDefinitions": [
{
"name":“scorekeep-api",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "scorekeep/api"}}
}
]}
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CLOUDWATCHLOGS
Logs Tab in the
Task Detail Page
View logs in the ECS or Cloudwatch Console
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T
Sébastien Stormacq
Technical Evangelist, AWS
@sebsto
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R
S U M M I T

Weitere ähnliche Inhalte

Was ist angesagt?

Deriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesDeriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesAmazon Web Services
 
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Amazon Web Services
 
Best practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSBest practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSAmazon Web Services
 
From Strategy to Reality: Better Decisions With Data
From Strategy to Reality: Better Decisions With DataFrom Strategy to Reality: Better Decisions With Data
From Strategy to Reality: Better Decisions With DataAmazon Web Services
 
Drive Digital Transformation using Machine Learning
Drive Digital Transformation using Machine LearningDrive Digital Transformation using Machine Learning
Drive Digital Transformation using Machine LearningAmazon Web Services
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019AWS Summits
 
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...Amazon Web Services
 
Continuous Integration and Continuous Delivery Best Practices for Building Mo...
Continuous Integration and Continuous Delivery Best Practices for Building Mo...Continuous Integration and Continuous Delivery Best Practices for Building Mo...
Continuous Integration and Continuous Delivery Best Practices for Building Mo...Amazon Web Services
 
利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統Amazon Web Services
 
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Amazon Web Services
 
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...Amazon Web Services
 
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWS
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWSReinventing SAP on AWS: Scale & Simplify SAP Operations on AWS
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWSAmazon Web Services
 
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_Complexity
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_ComplexityAccelerating_Enterprise_Cloud_Transformation_By_Master_IT_Complexity
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_ComplexityAmazon Web Services
 
Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...Amazon Web Services
 
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Amazon Web Services
 
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...AWS Summits
 
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...Amazon Web Services
 
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...Amazon Web Services
 

Was ist angesagt? (20)

Moving to DevOps the Amazon Way
Moving to DevOps the Amazon WayMoving to DevOps the Amazon Way
Moving to DevOps the Amazon Way
 
Deriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML ArchitecturesDeriving Value with Next Gen Analytics and ML Architectures
Deriving Value with Next Gen Analytics and ML Architectures
 
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
Budget management with Cloud Economics | AWS Summit Tel Aviv 2019
 
Best practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWSBest practices for running Windows workloads on AWS
Best practices for running Windows workloads on AWS
 
From Strategy to Reality: Better Decisions With Data
From Strategy to Reality: Better Decisions With DataFrom Strategy to Reality: Better Decisions With Data
From Strategy to Reality: Better Decisions With Data
 
Drive Digital Transformation using Machine Learning
Drive Digital Transformation using Machine LearningDrive Digital Transformation using Machine Learning
Drive Digital Transformation using Machine Learning
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...
Introduction to EC2 A1 instances, powered by the AWS Graviton processor - CMP...
 
Continuous Integration and Continuous Delivery Best Practices for Building Mo...
Continuous Integration and Continuous Delivery Best Practices for Building Mo...Continuous Integration and Continuous Delivery Best Practices for Building Mo...
Continuous Integration and Continuous Delivery Best Practices for Building Mo...
 
利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統
 
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
 
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...
AWS App Mesh: Manage services mesh discovery, recovery, and monitoring - MAD3...
 
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWS
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWSReinventing SAP on AWS: Scale & Simplify SAP Operations on AWS
Reinventing SAP on AWS: Scale & Simplify SAP Operations on AWS
 
Pro-Tips-for-Builders-on-AWS
Pro-Tips-for-Builders-on-AWSPro-Tips-for-Builders-on-AWS
Pro-Tips-for-Builders-on-AWS
 
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_Complexity
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_ComplexityAccelerating_Enterprise_Cloud_Transformation_By_Master_IT_Complexity
Accelerating_Enterprise_Cloud_Transformation_By_Master_IT_Complexity
 
Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...
 
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
 
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
Need for Speed – Intro To Real-Time Data Streaming Analytics on AWS | AWS Sum...
 
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...
Migrating on-premises Apache Spark and Hive to Amazon EMR - ADB304 - New York...
 
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...
Innovate - The Next Lap in Education: Accelerating Your Journey Through Innov...
 

Ähnlich wie Breaking the Monolith Using AWS Container Services

Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfAmazon Web Services
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfAmazon Web Services
 
AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...Cobus Bernard
 
AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...Cobus Bernard
 
AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...Cobus Bernard
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftAmazon Web Services
 
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Continuous Integration and Continuous Delivery for your serverless apps - Seb...Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Continuous Integration and Continuous Delivery for your serverless apps - Seb...Shift Conference
 
Modern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECSModern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECSAmazon Web Services
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentAmazon Web Services
 
Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...Amazon Web Services
 
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...Chargebee
 
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Amazon Web Services
 
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019Amazon Web Services
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudAWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudCobus Bernard
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the CloudCobus Bernard
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudAWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudCobus Bernard
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)Amazon Web Services Korea
 
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Amazon Web Services
 

Ähnlich wie Breaking the Monolith Using AWS Container Services (20)

Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...AWS DevDay Vienna - Automating building blocks choices you will face with con...
AWS DevDay Vienna - Automating building blocks choices you will face with con...
 
AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...AWS DevDay Cologne - Automating building blocks choices you will face with co...
AWS DevDay Cologne - Automating building blocks choices you will face with co...
 
AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...AWS DevDay Berlin - Automating building blocks choices you will face with con...
AWS DevDay Berlin - Automating building blocks choices you will face with con...
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up Loft
 
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Continuous Integration and Continuous Delivery for your serverless apps - Seb...Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
 
Modern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECSModern-Application-Design-with-Amazon-ECS
Modern-Application-Design-with-Amazon-ECS
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid Environment
 
Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...
 
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...
Powering Test Environments with Amazon EKS using Serverless Tool | AWS Commun...
 
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
 
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)
Container, Container, Container -유재석 (AWS 솔루션즈 아키텍트)
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudAWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudAWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the Cloud
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
 

Mehr von Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Breaking the Monolith Using AWS Container Services

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C T O R S U M M I T Breakingthe Monolith - Best Practices to RunYourContainersin theCloud Sébastien Stormacq Technical Evangelist, AWS @sebsto
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. The12 factorapplication I. Codebase One codebase w/ revision control, many deploys II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes VII. Port binding Export services via port binding VIII. Concurrency Scale out via the process model IX. Disposability Fast startup and graceful shutdown X. Dev/prod parity Keep environments as similar as possible XI. Logs Treat logs as event streams XII. Admin processes Run admin/management tasks as one-off processes
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Youknowwhat’sgreatfora12 factorapp?
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. RUNNINGASINGLECONTAINER
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. EC2 Instance TaskTask Task Task EC2 Instance TaskTask Task Task EC2 Instance TaskTask Task Task EC2 Instance TaskTask Task Task EC2 Instance TaskTask Task Task RUNNINGCONTAINERS
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. RUNNINGCONTAINERSATSCALEWITHECS Availability Zone #1 Availability Zone #2 Availability Zone #3 Scheduling and Orchestration Cluster Manager Placement Engine
  • 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS AMI Docker agent ECS agent ECSTaskECSTask ECSTaskECSTask EC2 Instance
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance Scheduling and Orchestration Cluster Manager Placement Engine
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. “Just launch 10 copies of my container distributed across three availability zones and connect them to this load balancer” X 10
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T One codebase tracked in revision control, many deploys
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Staging / QA Production Dev #1 Dev #2
  • 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Explicitly declare and isolate dependencies
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dependencies Dependencies Binaries Code
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Store config in the environment
  • 23. Development Production Same container deployed to both environments. Configuration is part of the environment on the host.
  • 25. Application code pulls from the environment Environment is customized when docker runs a container
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWSSecretsManager&TaskDefinitions "containerDefinitions": [ { "secrets": [ { "name": "environment_variable_name", "valueFrom": ”arn_of_your_secret" } ] } ]
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Treat backing services as attached resources
  • 28. PostgreSQLapp1 Host app2 3rd party service Treat local services just like remote third party ones
  • 29. PostgreSQLapp1 app2 Load balancer Use CNAMES for maximum flexibility and easy reconfiguration postgres.mycompany.com app2.mycompany.com
  • 30. Easily create and maintain custom maps of your applications Before Version 2 After Version 2
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Strictly separate build and run stages
  • 33. Release Config ReleaseBuild Artifact + = Tagged image stored in ECR
  • 35. Run Task Definition Release v1 Task Definition Release v2
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSappspec version: 1.0 Resources: - TargetService: Type: AWS::ECS::Service Properties: - TaskDefinition: "my_task_definition:8" LoadBalancerInfos: - ContainerName: "SampleApp" ContainerPort: 80 Hooks: - BeforeInstall: "LambdaFunctionToExecuteAnythingBeforeNewRevisionInstalltion" - AfterInstall: "LambdaFunctionToExecuteAnythingAfterNewRevisionInstallation" - AfterAllowTestTraffic: "LambdaFunctionToValidateAfterTestTrafficShift" - BeforeAllowTraffic: "LambdaFunctionToValidateBeforeTrafficShift" - AfterAllowTraffic: "LambdaFunctionToValidateAfterTrafficShift"
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment 100% Prod traffic
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment Target group 2 100% Prod traffic Test traffic listener (port 9000)
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment Green tasks: v2 code 100% Prod traffic Provision green tasks
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment 100% Test traffic 100% Prod traffic Run hook against test endpoint before green tasks receive prod traffic
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment 100% Prod traffic Flip traffic to green tasks, rollback in case of alarm 0% Prod traffic
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeDeploy-ECSblue-greendeployment 100% Prod traffic Drain blue tasks
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments • Docker tags are resolved when each container starts, not just during deployments • Deploying “latest” or “prod” can result in untested code in production after a scale-out event • Use unique “immutable” tags for deployments
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Build pushes new “latest” image Image: sha256@22222... (“latest”)
  • 46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Service scales up, launching new tasks Image: sha256@22222... (“latest”)
  • 47. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Deploy using immutable tags { "name": "sample-app", "image": "amazon/amazon-ecs- sample@sha256:3e39d933b1d948c92309bb583b5a1f3d28f0119e1551ca1fe538ba414a41af48d" } { "name": "sample-app", "image": "amazon/amazon-ecs-sample:build-b2085490-359f-4eaf-8970-6d1e26c354f0" } SHA256 Digest Build ID
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Compute immutable tags during build SHA256 Digest export IMAGE_URI=`docker inspect --format='{{index .RepoDigests 0}}' my_image:$IMAGE_TAG Example Result: amazon/amazon-ecs-sample@sha256:3e39d933b... Build ID export IMAGE_TAG=build-`echo $CODEBUILD_BUILD_ID | awk –F":" ‘{print $2}'` Example Result: build-b2085490-359f-4eaf-8970-6d1e26c354f0
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments
  • 50. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Build pushes new image tagged with new build ID Image: sha256@22222... (“build-22222”)
  • 51. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Service scales up, launching new tasks Image: sha256@22222... (“build-22222”)
  • 52. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerimagetaggingfordeployments Image: “build-22222” tag Deployment updates service’s task definition, replacing tasks Image: sha256@22222... (“build-22222”)
  • 53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Execute the app as one or more stateless processes
  • 54. Stateful container stores state in local disk or local memory. Workload ends up tied to a specific host that has state data. eu-west-1b Container 1 Disk eu-west-1ceu-west-1a
  • 55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Statefuldata Use services: • Amazon RDS • Amazon DynamoDB • Amazon ElasticCache • Amazon ElasticSearch • Amazon S3 • ……
  • 56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Export services via port binding
  • 58. Port 32768 Port 33487 Port 32192 Port 32794 Port 32781 Match: /api/users* Match: /api/auth*
  • 59. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Keep development, staging, and production as similar as possible
  • 60. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dev #1 Dev #2 Staging / QA Production
  • 61. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Staging / QA Production Dev #1 Dev #2 Local Application Remote
  • 62. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Model containerenvironmentswithAWS Cloud DevelopmentKit(CDK) Developer Preview • Open source framework to define cloud infrastructure in TypeScript, Java, C#, … • Provides library of higher-level resource types (“construct” classes) that have AWS best practices built in by default, packaged as npm modules • Provisions resources with CloudFormation • Supports all CloudFormation resource types AWS CDK https://awslabs.github.io/aws-cdk
  • 63. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDKtemplate import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run();
  • 64. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run(); CDKtemplate
  • 65. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDKtemplate import ec2 = require('@aws-cdk/aws-ec2'); import ecs = require('@aws-cdk/aws-ecs'); import cdk = require('@aws-cdk/cdk'); class BonjourFargate extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); const vpc = new ec2.VpcNetwork(this, 'MyVpc', { maxAZs: 2 }); const cluster = new ecs.Cluster(this, 'Cluster', { vpc }); new ecs.LoadBalancedFargateService( this, "FargateService", { cluster, image: ecs.DockerHub.image("amazon/amazon-ecs-sample"), }); } } const app = new cdk.App(); new BonjourFargate(app, 'Bonjour'); app.run();
  • 66. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Treat logs as event streams
  • 67. Docker connects container’s stdout to a log driver Containerized code writes to stdout
  • 68. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CLOUDWATCHLOGSCONFIGURATION { "containerDefinitions": [ { "name":“scorekeep-api", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "scorekeep/api"}} } ]}
  • 69. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CLOUDWATCHLOGS Logs Tab in the Task Detail Page View logs in the ECS or Cloudwatch Console
  • 70. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T
  • 71. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T Sébastien Stormacq Technical Evangelist, AWS @sebsto
  • 72. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C T O R S U M M I T

Hinweis der Redaktion

  1. Lets set out what a 12 factor app is and why it’s a good principle. In the past we would often treat a server as a machine which has a variety of roles. A single server may be responsible for serving web content, email, processing background jobs, and even hosting a database system. Your application is really only one of the many things that runs on that machine. Scaling with a traditional server model is hard. Adding a new machine takes time to provision. Those machines may store application data directly on their storage devices, including log files. It becomes more difficult to manage as your deployment infrastructure grows larger. A more modern approach is to use many virtual machines, containers, or even physical machines that serve a single purpose. This architecture will allow an application to scale horizontally without requiring lots of extra effort. If your application follows the 12 factor principles then scaling will be much easier and your app will be ready to run in a modern infrastructure.
  2. First lets talk about ESC and fargate, Then we’ll look how a 12 factor app fits into this.
  3. Getting started with containers is rather easy, you could even spin up one locally without much effort
  4. Or if you want to run containers in the cloud, you spin up some EC2 instances, launch containers on them and get going in minutes. This would work even if you are using dozens of containers. But as you think about scaling this, managing hundreds of such instances, monitoring their health, scaling them and launching your containers on them and the whole lifecycle around them…how do you scale for that?
  5. So lets say you plan to run several highly available applications across 3 different availability zones. [CLICK] ECS enables you to be able to operationalize your containerized workloads at very high scales. No management software to install or worry about its high availability. The cluster management piece enabled you to be able to monitor the cluster, scale it using autoscaling groups and be able to manage state of the instances in the cluster. The placement engine enables you to be able to set rules to target landing your containers on the right instances based on your preferences. And then finally, the advanced scheduling features help maintain the desired state of the application, spawn new containers to automatically respond to scaling needs and maintain resiliency by deploying across multiple availability zones while being resource aware of the underlying compute.
  6. If you double click on the instances it reveals that there is additional supporting software that you need to run, maintain and patch on ALL your virtual machines to support your containers like the Docker daemon and ECS Agent.
  7. So the real picture looked something like this. There are these additional layers of management you need to be aware of when all you wanted to do was run containers! [CLICK] Fargate support for ECS enables you to do just that – fully managed orchestration as well as data plane experience bringing your focus to only containers.
  8. Fargate you don’t even need to think of the infrastructure.
  9. First you have your code, But you need somewhere to store it So version control is the key, this example uses code commit but you can use other tools such as GitHub or Gitlab
  10. This lets you ensure code in all environments are aligned
  11. Code is one part but its not the end of the story, You often have libs and dependcies you need to include
  12. Docker lends it’s self to this very well. You can pull in code, bins and deps into one package
  13. Then the same code deps and libs can run anywhere. This helps get past the famous it runs on my machine problem.
  14. Config is just as important Its very tempting to do this. However this leads to the potential of having different config in dev/stage and prod. This may introduce errors into your deployment pipeline and effect production. So avoid this pattern at all costs
  15. Use the same docker container in all environments, Use environment variables or even secrets manager to pull configuration into that env
  16. If you’ve ever run docker locally and run the –E “XYZ=foobar” flag this can be used to configure the container. ECS and fargate also allow you to do this!
  17. You can also do it in the application code
  18. Consume everything like its an API and external service. Write your code to discover those services
  19. Or use cloud map with ECS
  20. AWS Cloud Map Use Cases : Service Discovery Continuous integration and delivery Automated health monitoring Increased availability Cloud Map constantly monitors the health of every IP-based component of your application and also dynamically updates the location of each microservice as they are added or removed. This ensures that your applications only discover the most up-to-date location of its resources, increasing the availability of the application. Increased developer productivity Cloud Map provides a single registry for all your application services which you can define with custom names. This ensures that your development teams don’t have to constantly store, track, and update resource name and location information or make changes directly within the application code.
  21. Use code build to look for changes committed to code commit and on a change start a build
  22. Don’t forget you can add the configuration to the Task definition also, So whilst our container has a config file, that file should rely on configuration stored in the Task definition of ECS/Fargate Explain a Task definition (to the k8s people in the room a task is a pod) The image and configuration of the application defined as code. A task can have up to 10(15 now check that) containers defined.
  23. And task definitions
  24. ALB’s and target groups are your friends. ALB’s allow you to route apps on a layer 7 basis to different microservice backends. Supporting IV. Processes (Execute the app as one or more stateless processes) When you use fargate / ECS a service is responsible for tracking ports and adding them to target groups, this takes away the heavy lifting.
  25. So ecs allows you to easily spread your work load out around your cluster and scale that application inside the cluster. You can also use placement constraints to stop two versions of the same app running on the same host.
  26. You can scale the hosts and the application inside. You scale hosts when you run out of resources to schedule more tasks or a placement group denies the task access due to your rules. You can also scale the number of tasks to cope with demand.
  27. This lets you ensure code in all environments are aligned
  28. This lets you ensure code in all environments are aligned
  29. The AWS CDK is an infrastructure modeling framework that allows you to define your cloud resources using an imperative programming interface. The CDK is currently in developer preview. We look forward to community feedback and collaboration.
  30. CDK is most useful to create high level structures, for example a VPC including your standard configurations for subnets, gateways, NAT, routing, security groups.
  31. OPTIONAL: a live demo with the CDK with this sample code
  32. Centralised logging is key! AWS logs is cloudwatch logs and is great for capturing logs without running infrastructure. If you want to use another rlog driver you can, but you make need to run log forwarders in you cluster and this just increases you maint and workload.
  33. Put admin tasks in containers Have the clusters pull and execute them Terminate the process properly