SlideShare a Scribd company logo
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cobus Bernard
Senior Technical Evangelist
Amazon Web Services
C O L O G N E
23.10.19
Automating Building Blocks:
Choices you will face with Container
Services
B A R 6
@cobusbernard
In/cobusbernard
cobusbernard
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Structureappsascollectionsofmicroservices
Properties of microservices
Microservices
• Independent
• Individually Deployed & Scaled
• Polyglot
• Modular - Easily Replaced
• Decentralized
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rigid Flexible
Abstractions
Easy Hard
1 System N Systems2 Systems
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monolith
Does everything
Monoliths are OK
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservicedevelopment lifecycle
developers services
monitorreleasetestbuild
delivery pipelines
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
monitorreleasetestbuild
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Usecodetomodelapplicationsandinfrastructure
Infrastructure ascode
Declarative
I tell you
what I need
I tell you
what to do
Imperative
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Usecodetomodelapplicationsandinfrastructure
Infrastructure ascode goals
1. Make infrastructure changes repeatable and predictable
2. Release infrastructure changes using the same tools as code changes
3. Replicate production environment in a staging environment to enable
continuous testing
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Model container environments withAWS
Cloud Development Kit(CDK)
• Open source framework to define cloud infrastructure
• JavaScript, TypeScript, and Python, (Java, and C# in
developer preview)
• Provides library of higher-level resource types
(“construct” classes) that have AWS best practices built
in by default
• 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.
CDKtemplate
applets:
MyHelloWorldService:
type: @aws-cdk/aws-ecs:LoadBalancedFargateServiceApplet
properties:
image: 'amazon/amazon-ecs-sample’
$ cdk --app ./my-applet.yaml deploy
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Model pipelines withAWSCDK
• Minimize copy-and-paste by using object-oriented language
• Define microservice pipeline “shape” in one class, then re-use it across
many pipelines
• CDK includes many high-level constructs for modeling a CodePipeline
pipeline, including automatically configuring IAM role policies
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDKpipelines:Construct
export class MyMicroservicePipeline extends cdk.Construct {
constructor(parent: cdk.Construct, name: string, props: MyMicroservicePipelineProps) {
super(parent, name);
const pipeline = new codepipeline.Pipeline(this, 'Pipeline', {
pipelineName: props.serviceName,
});
const githubAccessToken = new cdk.SecretParameter(this, 'GitHubToken',
{ ssmParameter: 'GitHubToken' });
new codepipeline.GitHubSourceAction(this, 'GitHubSource', {
stage: pipeline.addStage('Source'),
owner: 'myorg',
repo: props.serviceName,
oauthToken: githubAccessToken.value
});
…
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CDKpipelines:Stack
import cdk = require('@aws-cdk/cdk');
import { MyMicroservicePipeline } from './pipeline';
class MyMicroservicePipelinesStack extends cdk.Stack {
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
new MyMicroservicePipeline(this, 'Pipeline1', { 'serviceName': 'Microservice1' });
new MyMicroservicePipeline(this, 'Pipeline2', { 'serviceName': 'Microservice2' });
new MyMicroservicePipeline(this, 'Pipeline3', { 'serviceName': 'Microservice3' });
new MyMicroservicePipeline(this, 'Pipeline4', { 'serviceName': 'Microservice4' });
}
}
const app = new cdk.App();
new MyMicroservicePipelinesStack(app, 'MyMicroservicePipelines');
app.run();
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSCodeBuild
• Fully managed build service that compiles source
code, runs tests, and produces software packages
• Scales continuously and processes multiple builds
concurrently
• No build servers to manage
• Pay by the minute, only for the compute resources
you use
• Monitor builds through CloudWatch Events
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Usecodetomodelapplicationsandinfrastructure
Model function environments withAWSServerless
Application Model (SAM)
• Open source framework for building serverless
applications on AWS
• Shorthand syntax to express functions, APIs,
databases, and event source mappings
• Transforms and expands SAM syntax into AWS
CloudFormation syntax on deployment
• Supports all AWS CloudFormation resource types
https://aws.amazon.com/serverless/sam/
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containers and Docker
A container is a standard unit of software that packages up code and all its
dependencies so the application runs quickly and reliably from one
computing environment to another.1
1 https://www.docker.com/resources/what-container
Server
Operating System
Docker Engine
AppA
AppB
AppC
AppD
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
• 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.
Container imagetagging for deployments
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
Build pushes new “latest” image
Image: sha256@22222... (“latest”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
Service scales up, launching new tasks
Image: sha256@22222... (“latest”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
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.
Container imagetagging for deployments
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.
Container imagetagging for deployments
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
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.
Container imagetagging for deployments
Service scales up, launching new tasks
Image: sha256@22222... (“build-22222”)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container imagetagging for deployments
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. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Availability zone 1
Auto Scaling group
AWS Region
Availability zone 2
Auto-scaling for self-healing
Elastic Load
Balancing (ELB)
X
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Buildwithserverlesstechnologiesasmuchaspossible
AWS container serviceslandscape
Management
Deployment, Scheduling,
Scaling & Management of
containerized applications
Hosting
Where the containers run
Amazon Elastic
Container Service
Amazon Elastic
Container Service
for Kubernetes
Amazon EC2AWS Fargate
Image Registry
Container Image Repository
Amazon Elastic
Container Registry
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS key components
Development cluster
Container instance Container instance
Container instance
Productioncluster
Container instance Container instance
Container instance
AmazonElastic Container Service
(AmazonECS)
Container
Container
Volume
Taskdefinition
AmazonElastic Container Registry
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kubectl
EKS Architecture
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ShiftinInfrastructure Logic
OSS Hystrix:
code changes required
Service Mesh:
decentral, language agnostic,
dumb endpoints
https://www.infoq.com/articles/microservices-post-kubernetes
ESB: clustered monolith
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Open Source: Istio Service Mesh
Connect, secure, and observe services
• Shift in where functionality is located
• Control plane = Istio
• Data plane = set of all Envoy proxies
• Envoy proxy as sidecar in K8s pod
• Automatic or manual injection of proxy with EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Plane (Proxy)
• Touches every packet / request
• Service discovery
• Health Checking
• Routing
• Load Balancing
• Authentication / Authorization
• Observability
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IstioServiceMeshwithEnvoyProxy
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Envoy Proxy
• Level 7 proxy
• HTTP, HTTP/2, gRPC, AWS Dynamo DB, MongoDB
• C++11 code base , only 8 MB (statically linked)
• No language or framework dependencies
• Rquires no code changes
• Battle proved OSS, started at Lyft
• Works across compute options – also on EC2
• Envoy is not tightly coupled Istio
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Service Mesh
But Docker / Kubernetes can do rolling updates!
Yes, but Istio sparates traffic flow
from replica deployment
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
UpdateStrategies
A bath tub full of cold water ? K8s roling update
25%
1 pod at a time
… or just wetten your feet? Service Mesh
3%
Traffic routing
🛁 🛁 🛁
💦
🛀🏽🛁
🌊❄️🌊❄️🌊❄️
Fancy a Swim in the Arctic Sea ?
Blue / Green
100%
All services at once
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
User Based Routing Traffic Shifting
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Control Plane (Istio)
• Routing information
• Policies & configuration
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App Mesh works across compute services
Amazon ECS
AWS Fargate
Amazon EKS
Amazon EC2
Kubernetes on EC2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Based on Envoy proxy
Start App Mesh from the AWS CLI, console or SDK
There is no additional charge for using AWS App Mesh
Supports any third-party tool that works with Envoy
App Mesh
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cobus Bernard
Senior Technical Evangelist
Amazon Web Services
@cobusbernard
In/cobusbernard
cobusbernard
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pleaseratethesession

More Related Content

Similar to AWS DevDay Cologne - Automating building blocks choices you will face with container services (13)

PPTX
AWS DevDay Vienna - Automating building blocks choices you will face with con...
Cobus Bernard
 
PPTX
AWS DevDay Berlin - Automating building blocks choices you will face with con...
Cobus Bernard
 
PDF
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Shift Conference
 
PPTX
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
Cobus Bernard
 
PPTX
AWS SSA Webinar 12 - Getting started on AWS with Containers
Cobus Bernard
 
PPTX
DevConfZA 2020 : Automating your cloud: What are the building blocks
Cobus Bernard
 
PPTX
AWS DevDay Cologne - CI/CD for modern applications
Cobus Bernard
 
PDF
From Code to a running container | AWS Summit Tel Aviv 2019
AWS Summits
 
PPTX
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
PPTX
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
PPTX
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
PDF
Frome Code to Cloud: Exploring AWS CDK for Infrastructure Management
Sujay Pillai
 
PDF
DevOps Spain 2019. Pedro Mendoza-AWS
atSistemas
 
AWS DevDay Vienna - Automating building blocks choices you will face with con...
Cobus Bernard
 
AWS DevDay Berlin - Automating building blocks choices you will face with con...
Cobus Bernard
 
Continuous Integration and Continuous Delivery for your serverless apps - Seb...
Shift Conference
 
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
Cobus Bernard
 
AWS SSA Webinar 12 - Getting started on AWS with Containers
Cobus Bernard
 
DevConfZA 2020 : Automating your cloud: What are the building blocks
Cobus Bernard
 
AWS DevDay Cologne - CI/CD for modern applications
Cobus Bernard
 
From Code to a running container | AWS Summit Tel Aviv 2019
AWS Summits
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
Frome Code to Cloud: Exploring AWS CDK for Infrastructure Management
Sujay Pillai
 
DevOps Spain 2019. Pedro Mendoza-AWS
atSistemas
 

More from Cobus Bernard (20)

PPTX
London Microservices Meetup: Lessons learnt adopting microservices
Cobus Bernard
 
PPTX
AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...
Cobus Bernard
 
PPTX
AWS SSA Webinar 33 - Getting started with databases on AWS Amazon DynamoDB
Cobus Bernard
 
PPTX
AWS SSA Webinar 32 - Getting Started with databases on AWS: Choosing the righ...
Cobus Bernard
 
PPTX
AWS SSA Webinar 30 - Getting Started with AWS - Infrastructure as Code - Terr...
Cobus Bernard
 
PPTX
AWS Webinar 24 - Getting Started with AWS - Understanding DR
Cobus Bernard
 
PPTX
AWS Webinar 23 - Getting Started with AWS - Understanding total cost of owner...
Cobus Bernard
 
PPTX
AWS SSA Webinar 21 - Getting Started with Data lakes on AWS
Cobus Bernard
 
PDF
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
Cobus Bernard
 
PPTX
AWS SSA Webinar 19 - Getting Started with Multi-Region Architecture: Services
Cobus Bernard
 
PPTX
AWS SSA Webinar 18 - Getting Started with Multi-Region Architecture: Data
Cobus Bernard
 
PPTX
AWS EMEA Online Summit - Live coding with containers
Cobus Bernard
 
PPTX
AWS EMEA Online Summit - Blending Spot and On-Demand instances to optimizing ...
Cobus Bernard
 
PPTX
AWS SSA Webinar 17 - Getting Started on AWS with Amazon RDS
Cobus Bernard
 
PPTX
AWS SSA Webinar 16 - Getting Started on AWS with Amazon EC2
Cobus Bernard
 
PPTX
AWS SSA Webinar 15 - Getting started on AWS with Containers: Amazon EKS
Cobus Bernard
 
PPTX
AWS SSA Webinar 13 - Getting started on AWS with Containers: Amazon ECS
Cobus Bernard
 
PPTX
AWS SSA Webinar 11 - Getting started on AWS: Security
Cobus Bernard
 
PPTX
HashiTalks Africa - Going multi-account on AWS with Terraform
Cobus Bernard
 
PPTX
AWS SSA Webinar 10 - Getting Started on AWS: Networking
Cobus Bernard
 
London Microservices Meetup: Lessons learnt adopting microservices
Cobus Bernard
 
AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...
Cobus Bernard
 
AWS SSA Webinar 33 - Getting started with databases on AWS Amazon DynamoDB
Cobus Bernard
 
AWS SSA Webinar 32 - Getting Started with databases on AWS: Choosing the righ...
Cobus Bernard
 
AWS SSA Webinar 30 - Getting Started with AWS - Infrastructure as Code - Terr...
Cobus Bernard
 
AWS Webinar 24 - Getting Started with AWS - Understanding DR
Cobus Bernard
 
AWS Webinar 23 - Getting Started with AWS - Understanding total cost of owner...
Cobus Bernard
 
AWS SSA Webinar 21 - Getting Started with Data lakes on AWS
Cobus Bernard
 
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
Cobus Bernard
 
AWS SSA Webinar 19 - Getting Started with Multi-Region Architecture: Services
Cobus Bernard
 
AWS SSA Webinar 18 - Getting Started with Multi-Region Architecture: Data
Cobus Bernard
 
AWS EMEA Online Summit - Live coding with containers
Cobus Bernard
 
AWS EMEA Online Summit - Blending Spot and On-Demand instances to optimizing ...
Cobus Bernard
 
AWS SSA Webinar 17 - Getting Started on AWS with Amazon RDS
Cobus Bernard
 
AWS SSA Webinar 16 - Getting Started on AWS with Amazon EC2
Cobus Bernard
 
AWS SSA Webinar 15 - Getting started on AWS with Containers: Amazon EKS
Cobus Bernard
 
AWS SSA Webinar 13 - Getting started on AWS with Containers: Amazon ECS
Cobus Bernard
 
AWS SSA Webinar 11 - Getting started on AWS: Security
Cobus Bernard
 
HashiTalks Africa - Going multi-account on AWS with Terraform
Cobus Bernard
 
AWS SSA Webinar 10 - Getting Started on AWS: Networking
Cobus Bernard
 
Ad

Recently uploaded (20)

PPTX
Orchestrating things in Angular application
Peter Abraham
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PDF
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PPTX
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
PPTX
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
PDF
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PPTX
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Orchestrating things in Angular application
Peter Abraham
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
西班牙巴利阿里群岛大学电子版毕业证{UIBLetterUIB文凭证书}文凭复刻
Taqyea
 
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Networking_Essentials_version_3.0_-_Module_5.pptx
ryan622010
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Ad

AWS DevDay Cologne - Automating building blocks choices you will face with container services

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cobus Bernard Senior Technical Evangelist Amazon Web Services C O L O G N E 23.10.19 Automating Building Blocks: Choices you will face with Container Services B A R 6 @cobusbernard In/cobusbernard cobusbernard
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Structureappsascollectionsofmicroservices Properties of microservices Microservices • Independent • Individually Deployed & Scaled • Polyglot • Modular - Easily Replaced • Decentralized
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rigid Flexible Abstractions Easy Hard 1 System N Systems2 Systems
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monolith Does everything Monoliths are OK
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Microservicedevelopment lifecycle developers services monitorreleasetestbuild delivery pipelines monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Usecodetomodelapplicationsandinfrastructure Infrastructure ascode Declarative I tell you what I need I tell you what to do Imperative
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Usecodetomodelapplicationsandinfrastructure Infrastructure ascode goals 1. Make infrastructure changes repeatable and predictable 2. Release infrastructure changes using the same tools as code changes 3. Replicate production environment in a staging environment to enable continuous testing
  • 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Model container environments withAWS Cloud Development Kit(CDK) • Open source framework to define cloud infrastructure • JavaScript, TypeScript, and Python, (Java, and C# in developer preview) • Provides library of higher-level resource types (“construct” classes) that have AWS best practices built in by default • Provisions resources with CloudFormation • Supports all CloudFormation resource types AWS CDK https://awslabs.github.io/aws-cdk
  • 10. © 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();
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDKtemplate applets: MyHelloWorldService: type: @aws-cdk/aws-ecs:LoadBalancedFargateServiceApplet properties: image: 'amazon/amazon-ecs-sample’ $ cdk --app ./my-applet.yaml deploy
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Model pipelines withAWSCDK • Minimize copy-and-paste by using object-oriented language • Define microservice pipeline “shape” in one class, then re-use it across many pipelines • CDK includes many high-level constructs for modeling a CodePipeline pipeline, including automatically configuring IAM role policies
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDKpipelines:Construct export class MyMicroservicePipeline extends cdk.Construct { constructor(parent: cdk.Construct, name: string, props: MyMicroservicePipelineProps) { super(parent, name); const pipeline = new codepipeline.Pipeline(this, 'Pipeline', { pipelineName: props.serviceName, }); const githubAccessToken = new cdk.SecretParameter(this, 'GitHubToken', { ssmParameter: 'GitHubToken' }); new codepipeline.GitHubSourceAction(this, 'GitHubSource', { stage: pipeline.addStage('Source'), owner: 'myorg', repo: props.serviceName, oauthToken: githubAccessToken.value }); …
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDKpipelines:Stack import cdk = require('@aws-cdk/cdk'); import { MyMicroservicePipeline } from './pipeline'; class MyMicroservicePipelinesStack extends cdk.Stack { constructor(parent: cdk.App, name: string, props?: cdk.StackProps) { super(parent, name, props); new MyMicroservicePipeline(this, 'Pipeline1', { 'serviceName': 'Microservice1' }); new MyMicroservicePipeline(this, 'Pipeline2', { 'serviceName': 'Microservice2' }); new MyMicroservicePipeline(this, 'Pipeline3', { 'serviceName': 'Microservice3' }); new MyMicroservicePipeline(this, 'Pipeline4', { 'serviceName': 'Microservice4' }); } } const app = new cdk.App(); new MyMicroservicePipelinesStack(app, 'MyMicroservicePipelines'); app.run();
  • 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWSCodeBuild • Fully managed build service that compiles source code, runs tests, and produces software packages • Scales continuously and processes multiple builds concurrently • No build servers to manage • Pay by the minute, only for the compute resources you use • Monitor builds through CloudWatch Events
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Usecodetomodelapplicationsandinfrastructure Model function environments withAWSServerless Application Model (SAM) • Open source framework for building serverless applications on AWS • Shorthand syntax to express functions, APIs, databases, and event source mappings • Transforms and expands SAM syntax into AWS CloudFormation syntax on deployment • Supports all AWS CloudFormation resource types https://aws.amazon.com/serverless/sam/
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containers and Docker A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.1 1 https://www.docker.com/resources/what-container Server Operating System Docker Engine AppA AppB AppC AppD
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments • 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
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments Build pushes new “latest” image Image: sha256@22222... (“latest”)
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments Service scales up, launching new tasks Image: sha256@22222... (“latest”)
  • 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments 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
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments 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
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments Build pushes new image tagged with new build ID Image: sha256@22222... (“build-22222”)
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments Service scales up, launching new tasks Image: sha256@22222... (“build-22222”)
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container imagetagging for deployments Image: “build-22222” tag Deployment updates service’s task definition, replacing tasks Image: sha256@22222... (“build-22222”)
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Availability zone 1 Auto Scaling group AWS Region Availability zone 2 Auto-scaling for self-healing Elastic Load Balancing (ELB) X
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Buildwithserverlesstechnologiesasmuchaspossible AWS container serviceslandscape Management Deployment, Scheduling, Scaling & Management of containerized applications Hosting Where the containers run Amazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Amazon EC2AWS Fargate Image Registry Container Image Repository Amazon Elastic Container Registry
  • 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS key components Development cluster Container instance Container instance Container instance Productioncluster Container instance Container instance Container instance AmazonElastic Container Service (AmazonECS) Container Container Volume Taskdefinition AmazonElastic Container Registry
  • 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kubectl EKS Architecture
  • 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ShiftinInfrastructure Logic OSS Hystrix: code changes required Service Mesh: decentral, language agnostic, dumb endpoints https://www.infoq.com/articles/microservices-post-kubernetes ESB: clustered monolith
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Open Source: Istio Service Mesh Connect, secure, and observe services • Shift in where functionality is located • Control plane = Istio • Data plane = set of all Envoy proxies • Envoy proxy as sidecar in K8s pod • Automatic or manual injection of proxy with EKS
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data Plane (Proxy) • Touches every packet / request • Service discovery • Health Checking • Routing • Load Balancing • Authentication / Authorization • Observability
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. IstioServiceMeshwithEnvoyProxy
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Envoy Proxy • Level 7 proxy • HTTP, HTTP/2, gRPC, AWS Dynamo DB, MongoDB • C++11 code base , only 8 MB (statically linked) • No language or framework dependencies • Rquires no code changes • Battle proved OSS, started at Lyft • Works across compute options – also on EC2 • Envoy is not tightly coupled Istio
  • 46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Service Mesh But Docker / Kubernetes can do rolling updates! Yes, but Istio sparates traffic flow from replica deployment
  • 47. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. UpdateStrategies A bath tub full of cold water ? K8s roling update 25% 1 pod at a time … or just wetten your feet? Service Mesh 3% Traffic routing 🛁 🛁 🛁 💦 🛀🏽🛁 🌊❄️🌊❄️🌊❄️ Fancy a Swim in the Arctic Sea ? Blue / Green 100% All services at once
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. User Based Routing Traffic Shifting
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Control Plane (Istio) • Routing information • Policies & configuration
  • 50. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. App Mesh works across compute services Amazon ECS AWS Fargate Amazon EKS Amazon EC2 Kubernetes on EC2
  • 51. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Based on Envoy proxy Start App Mesh from the AWS CLI, console or SDK There is no additional charge for using AWS App Mesh Supports any third-party tool that works with Envoy App Mesh
  • 52. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cobus Bernard Senior Technical Evangelist Amazon Web Services @cobusbernard In/cobusbernard cobusbernard
  • 53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pleaseratethesession

Editor's Notes

  • #3: Each team can move independently and simultaneously In contrast to Monolith (where the Deployment Unit is the entire program), Microservice has a separate deployment pipeline, enabling us to make small changes and speed up our Release Velocity. Each microprocessor can be written in a different language, and each team can choose its own technology stack - the most convenient or appropriate tools. Modularity - Because each unit is small, it can be easily replaced. Distributed work reduces dependence between different parts - but there are, however, common principles that aim to facilitate coordination and organizational standards.
  • #4: When you know you’re going to need to eventually handle more than one type of a thing, consider generalizing. Take for example integrating payments systems, building for one is easy but integrating with any system, even those you are unaware of is really hard. Click Generalize… But just barely-, make your system capable of handling two kinds of things. This will help you avoid too tightly coupling. Click As long as the systems are not too similar you will be abstracting a good amount of flexibility for the effort.
  • #5: Starting with a monolith is often the right choice, it allows for fast development at the early stage. As you don’t need to design the process boundaries ahead of time. A designed monolith can be scaled horizontally and broken apart later if needed. Depending on the type of startup, you may never outgrow the scaling capacity of a well-designed monolith.
  • #6: The solution is self-service tools and automation….enabling each one of the DevOps teams to own and manage their own release process.
  • #8: There are different approaches for IaC, but it is important to use one with declarative syntax, like CloudFormation or Terraform
  • #10: 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.
  • #11: OPTIONAL: a live demo with the CDK with this sample code
  • #12: Applets are YAML files that directly instantiate constructs, without writing any code.
  • #13: To configure AWS CodePipeline pipelines with the CDK. When you add a microservice, you need to create a new pipeline, similar to your other ones. With CDK you can use an higher level class instead of copying and pasting lots of YAML code.
  • #14: Constructs are the building blocks of AWS CDK applications. Constructs can have child constructs, which in turn can have child constructs, forming a hierarchical tree structure. The AWS CDK includes two different levels of constructs: CloudFormation Resource These constructs are low-level constructs that provide a direct, one-to-one, mapping to an AWS CloudFormation resource, as listed in the AWS CloudFormation topic AWS Resource Types Reference. All CloudFormation Resource members are found in the @aws-cdk/resources package. AWS Construct Library These constructs have been handwritten by AWS and come with convenient defaults and additional knowledge about the inner workings of the AWS resources they represent. In general, you will be able to express your intent without worrying about the details too much, and the correct resources will automatically be defined for you. AWS Construct Library members are found in the @aws-cdk/NAMESPACE packages, where NAMESPACE is the short name for the associated service, such as SQS for the AWS Construct Library for the Amazon SQS service. See the Reference section for descriptions of the AWS CDK packages and constructs.
  • #15: In the stack you can use the constructs you defines before, like the pipeline we created in the previous slide.
  • #32: The most common purpose for an auto scaling groups is resiliency; instances are put into a fixed-size auto scaling group so that if an instance fails, it is automatically replaced. The simplest use case is an auto scaling group has a min size bigger than 1.
  • #33: The current AWS container services landscape covers a broad set of products. Not all are serverless (Fargate) So you have other options. At the orchestration layer we’ve Amazon ECS and Amazon EKS. EKS makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS. You can currently run your containers on ECS using either the EC2 launch type – where get to manage the the underlying instances on which your containers are running - or you can choose to run your containers in a serverless manner with the AWS Fargate launch type. Finally, we provide a registry services, Amazon ECR, where you can store your container images.
  • #35: Fully managed control plane: Multi az, right sized master setup etcd scaled automatically, Provisioned IOPS, snapshotted at intervals Worker nodes: Spot instances / GPU / autoscaling group You can think about EKS as a managed Kubernetes API endpoint. It’s upstream Kubernetes, no forking: So you can take your kubectl and communicate with the endpoint. Use all your tools
  • #39: Creation + storing Rotation Dynamic - storming
  • #42: ESB: Dumb endpoints smart pipes uS: Smart endpoints, dump pipes Retries, circuit breaker pattern, routing etc. Netflix Open Source Software Center
  • #43: Creating services is easier, Manage parts go harder. New pattern: offload to proxy Istio is the control plane and Envoy is the data plan Istio, at its core, handles the routing, load balancing, flow control and security needs of microservices. It sits on top of existing distributed applications and basically helps them talk to each other securely, while also providing logging, telemetry and the necessary policies that keep things under control (and secure). It also features support for canary releases, which allow developers to test updates with a few users before launching them to a wider audience, something that Google and other webscale companies have long done internally. The data plane is composed of a set of intelligent proxies (Envoy) deployed as sidecars. These proxies mediate and control all network communication between microservices Touches every packet/request in the system. Responsible for service discovery, health checking, routing, load balancing, authentication/authorization, and observability. Service mesh control plane: Provides policy and configuration for all of the running data planes in the mesh. Does not touch any packets/requests in the system. The control plane turns all proxies into a distributed system. https://blog.envoyproxy.io/service-mesh-data-plane-vs-control-plane-2774e720f7fc
  • #44: Originally from Lyft Envoy is a nice peace of engineering with a lot of good background articles to read: Now used by various cloud providers and in OSS projects to build everything from API GW to LBs Linkerd and Nginx have shown Istio integration. Data plane can be swapped. Not so tightly coupled Since it is level 7, it can route for URL, user agent = Safari / Chrome ,
  • #45: Explain sidecar pattern, same network namespace IP/ports. Sidecar injection: default namespace gets a tag. Istio injects pod when tag is set. Chaos engineering. Try to break things before they break in prod. Add delay of 5 seconds. Kubectl apply -f CRD: kubectl get virtualservices ### The service mesh a lot of attention right now (rightly so!) The Istio model of a service is independent of how it is represented in the underlying platform (Kubernetes, Mesos, Cloud Foundry, etc.).  clients of a service have no knowledge of different versions of the service, continue to use host / IP VirtualService:  rules that control how requests for a service are routed within an Istio service mesh. Kubetctl get virtualservices / destinationrules – uses CUSTOM RESOURCE DEF https://istio.io/docs/concepts/traffic-management/#rule-configuration
  • #46: Originally from Lyft Envoy is a nice peace of engineering with a lot of good background articles to read: Now used by various cloud providers and in OSS projects to build everything from API GW to LBs Linkerd and Nginx have shown Istio integration. Data plane can be swapped. Not so tightly coupled Since it is level 7, it can route for URL, user agent = Safari / Chrome ,
  • #48: Replica deployment / traffic flow Free symbol https://iccpic.com/free-icon/bathtub-house_64734.html https://iccpic.com/free-icon/foot_479564.html
  • #50: Originally from Lyft Envoy is a nice peace of engineering with a lot of good background articles to read: Now used by various cloud providers and in OSS projects to build everything from API GW to LBs Linkerd and Nginx have shown Istio integration. Data plane can be swapped. Not so tightly coupled Since it is level 7, it can route for URL, user agent = Safari / Chrome ,
  • #51: It is all the same mesh. Use mesh to migrate from monolith to containers Mesh Does not have to be container, helps to containerize. Remember the options for modernization of legacy apps: different solutions App mesh embraces them all Based on Istio data plane, but we implemented a control plane and that HA, for you. ECS, Fargate: You add the Envoy proxy image to the task definition OBSERV, Tracing: Iintegrated with Cwatch log & metric, X Ray Traffic Management: LB, Path based routing