SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerizing Legacy .NET
Workloads
Nicki Klein
Sr. Technical Evangelist
Amazon Web Services
Brian Lewis
Sr. Solutions Architect
Amazon Web Services
C O N 3 4 8
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containerize a Legacy ASP.NET app
Deploying a .NET app
container to Amazon
Elastic Container
Service (Amazon ECS)
Hypervisor
Status:on
Connections Connections Connections
Network Up/NetworkDown
Amazon
ECS
AZ1 AZ2
Private Subnet
Public Subnet
Internet
Gateway
Private Subnet
Public Subnet
NAT
GATEWAY
NAT
GATEWAY
ALB
Amazon ECS Cluster
What we will cover
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Recent AWS .NET related announcements
• .NET Developer Center (aws.amazon.com/net)—7/2
• .NET Core 2.1 on Amazon Linux and Ubuntu—7/13
• .NET Core 2.1 on AWS Lambda—7/19
• .NET Global Tools—9/10
• PowerShell for Lambda—9/11
• .NET CDK – 9/13
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Windows deployment modes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
.Net 4.x requires server core
Server 2016 version 1803—server core:
•1.58GB, download size, 30% reduction from Windows Server, version 1709
•3.61GB, on disk size, 20% reduction from Windows Server, version 1709
Server version Size on disk
Server 2016 – Server Core ~ 8 Gig
Serve 2016 version 1709 – Server Core ~4.5 Gig
Server 2016 version 1803 - Server Core: ~ 3.6 Gig
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of Windows containers
• Ease of movement (on-prem or in public cloud)
• Improve operating system utilization/density
• Development/Deployment runtime consistency
• Deployment size and speed/use of base images
• Server boot times under 1 second
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What’s our sample .NET app?
• Sample app circa 2010
• ASP.NET MVC 1.0
• SQL Server Express LocalDB
https://github.com/kneekey23/NerdDinner
NerdDinner
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WinNat network mode
• Similar to bridge mode on Linux
• Container have private IP address only accessible from the host
• Cannot access exposed ports via localhost
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo:
Containerize a legacy
ASP.NET appHypervisor
Status:on
Connections Connections Connections
Network Up/NetworkDown
Amazon
ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microsoft SQL server in a container
Production SQL server container images must be pulled from the Docker
store
• docker pull microsoft/mssql-server-windows
• docker pull microsoft/mssql-server-linux:2017-latest
For persistent SQL data:
• Use data volume containers
• Store the database on a file share (SMB 3.2 suggested)
• Mount a host directory as data volume (Linux)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Volumes for Windows containers
• Basic volumes work
• Mounting folders—only for folders on the same drive where containers layers are stored
• Plugins for volume not yet supported
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo:
Containerizing
Microsoft SQL serverHypervisor
Status:on
Connections Connections Connections
Network Up/NetworkDown
Amazon
ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Storing images in Amazon Elastic Container Registry
(Amazon ECR)
• Amazon ECR Credential Helper for Docker to simplify authentication
• Microsoft base layers are not pushed to Amazon ECR by default
• Compresses image size by 85-90% before storing in Amazon ECR
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Steps to containerize the legacy .NET app
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best practice:
When building your application, build it in a disposable container and
publish in new containers. This will keep the size of your production
containers down and reduce the attack surface of the containers.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS for Windows Server 2016
• Dec 5, 2017—Windows Server containers for
production workloads!
• ECS-optimized Windows Server 2016 AMI
• Includes Docker 17.06 Enterprise Edition
• Amazon ECS agent now runs as a native Windows
service
• Windows containers memory and CPU limit(s)
enforcement
• PowerShell module can be use to configure
Amazon ECS agent
• By default, logs are stored in the Windows Event
Viewer
Windows Server on Amazon ECS:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS for Windows Server 2016
• Reference architecture on GitHub
Step 1. Build ECS cluster
https://github.com/aws-samples/ecs-
refarch-cloudformation-windows
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS for Windows Server 2016
Step 2. Create task definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Task definitions for Windows containers
• Most task definition fields of Linux containers work on Windows containers as well
• Some task definition fields need changes to Windows specifics such as volume path
• Network mode—only WinNAT mode is supported
• Container links are not supported
• Ulimits field is not supported
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS for Windows Server 2016
• Service name
• Number of tasks
• Elastic Load Balancing
AWS Identity and
Access Management
(IAM) role
Step 3.
Create service & launch
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS
AZ1 AZ2
Private Subnet
Public Subnet
Internet
Gateway
Private Subnet
Public Subnet
NAT
GATEWAY
NAT
GATEWAY
ALB
Amazon ECS Cluster
Demo:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Next steps: After you migrate your app
Modernizing your .NET apps
• Rewriting the application is always the cleanest path
• Windows containers offer another option
Use Docker to take a feature-driven approach to breaking up the monolithic
application, splitting the functionality across multiple containers and using Docker
for the plumbing. Use .NET core to extend the application.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Container Competency—Just announced
• APN partners with this designation have a
validated product or solution on AWS that
supports workloads on containers
• These solutions improve customer's ability to
leverage containers on AWS
• Focus areas include:
• Foundation, orchestration, & scheduling
• Monitoring & logging
• Security
• 17 launch partners
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Container Competency launch partners
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Code from Demos:
https://github.com/kneekey23/NerdDinner
Nicki Klein—Technical Evangelist @nicki_23
Brian Lewis—Solutions Architect
Want to learn more on .NET and windows containers:
Break out session - WIN305 - Containerize Legacy .NET Framework Web Apps for Cloud Migration –
Tuesday 27, Nov 2018 4:00 PM – 5:00 PM – Bellagio, Level1, Grand Ballroom2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Post-Production Media Delivery at Scale with AWS (STG391) - AWS re:Invent 2018
Post-Production Media Delivery at Scale with AWS (STG391) - AWS re:Invent 2018Post-Production Media Delivery at Scale with AWS (STG391) - AWS re:Invent 2018
Post-Production Media Delivery at Scale with AWS (STG391) - AWS re:Invent 2018
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
 
Building Serverless Analytics Solutions with Amazon QuickSight (ANT391) - AWS...
Building Serverless Analytics Solutions with Amazon QuickSight (ANT391) - AWS...Building Serverless Analytics Solutions with Amazon QuickSight (ANT391) - AWS...
Building Serverless Analytics Solutions with Amazon QuickSight (ANT391) - AWS...
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
 
Secure Your Site: Use CDN Security Features to Protect Your Content & Infrast...
Secure Your Site: Use CDN Security Features to Protect Your Content & Infrast...Secure Your Site: Use CDN Security Features to Protect Your Content & Infrast...
Secure Your Site: Use CDN Security Features to Protect Your Content & Infrast...
 
Save up to 90% Using Multiple Purchase Options in Amazon EC2 Auto Scaling (CM...
Save up to 90% Using Multiple Purchase Options in Amazon EC2 Auto Scaling (CM...Save up to 90% Using Multiple Purchase Options in Amazon EC2 Auto Scaling (CM...
Save up to 90% Using Multiple Purchase Options in Amazon EC2 Auto Scaling (CM...
 
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
 
Intro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksIntro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech Talks
 
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
 
Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit Optimize Amazon EC2 for Fun and Profit
Optimize Amazon EC2 for Fun and Profit
 
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
 
Deep Dive on Amazon Elastic File System (Amazon EFS) (STG301-R1) - AWS re:Inv...
Deep Dive on Amazon Elastic File System (Amazon EFS) (STG301-R1) - AWS re:Inv...Deep Dive on Amazon Elastic File System (Amazon EFS) (STG301-R1) - AWS re:Inv...
Deep Dive on Amazon Elastic File System (Amazon EFS) (STG301-R1) - AWS re:Inv...
 
Design, Deploy, and Optimize Microsoft SQL Server on AWS (GPSTEC314) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (GPSTEC314) - AWS re...Design, Deploy, and Optimize Microsoft SQL Server on AWS (GPSTEC314) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (GPSTEC314) - AWS re...
 
Move Data to AWS Faster for Migrations, DR, & Bidirectional Workflows (STG382...
Move Data to AWS Faster for Migrations, DR, & Bidirectional Workflows (STG382...Move Data to AWS Faster for Migrations, DR, & Bidirectional Workflows (STG382...
Move Data to AWS Faster for Migrations, DR, & Bidirectional Workflows (STG382...
 
High Performance Computing on AWS: Driving Innovation without Infrastructure ...
High Performance Computing on AWS: Driving Innovation without Infrastructure ...High Performance Computing on AWS: Driving Innovation without Infrastructure ...
High Performance Computing on AWS: Driving Innovation without Infrastructure ...
 
Work Anywhere with Amazon Workspaces (Level: 200)
Work Anywhere with Amazon Workspaces (Level: 200)Work Anywhere with Amazon Workspaces (Level: 200)
Work Anywhere with Amazon Workspaces (Level: 200)
 
AWS Data Transfer Services Deep Dive
AWS Data Transfer Services Deep Dive AWS Data Transfer Services Deep Dive
AWS Data Transfer Services Deep Dive
 
Discover & Migrate at Scale with AWS Migration Hub & Application Discovery Se...
Discover & Migrate at Scale with AWS Migration Hub & Application Discovery Se...Discover & Migrate at Scale with AWS Migration Hub & Application Discovery Se...
Discover & Migrate at Scale with AWS Migration Hub & Application Discovery Se...
 
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
 
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
 

Similar a Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018

Similar a Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018 (20)

SRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateSRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS Fargate
 
AWS 微服務中的 Container 選項比較 (Level 400)
AWS 微服務中的 Container 選項比較   (Level 400)AWS 微服務中的 Container 選項比較   (Level 400)
AWS 微服務中的 Container 選項比較 (Level 400)
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Containerize Legacy .NET Framework Web Apps for Cloud Migration (WIN305) - AW...
Containerize Legacy .NET Framework Web Apps for Cloud Migration (WIN305) - AW...Containerize Legacy .NET Framework Web Apps for Cloud Migration (WIN305) - AW...
Containerize Legacy .NET Framework Web Apps for Cloud Migration (WIN305) - AW...
 
Containerize Legacy .NET Framework Web Apps for Cloud Migration - ENT201 - Ch...
Containerize Legacy .NET Framework Web Apps for Cloud Migration - ENT201 - Ch...Containerize Legacy .NET Framework Web Apps for Cloud Migration - ENT201 - Ch...
Containerize Legacy .NET Framework Web Apps for Cloud Migration - ENT201 - Ch...
 
Deep Dive into Amazon Fargate
Deep Dive into Amazon FargateDeep Dive into Amazon Fargate
Deep Dive into Amazon Fargate
 
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration
 
Thomson Reuters Shows How It Hosted a .NET App on Amazon ECS Using Windows Co...
Thomson Reuters Shows How It Hosted a .NET App on Amazon ECS Using Windows Co...Thomson Reuters Shows How It Hosted a .NET App on Amazon ECS Using Windows Co...
Thomson Reuters Shows How It Hosted a .NET App on Amazon ECS Using Windows Co...
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
 
Deploy and Scale a Cloud Application with Amazon Lightsail (CMP410-R2) - AWS ...
Deploy and Scale a Cloud Application with Amazon Lightsail (CMP410-R2) - AWS ...Deploy and Scale a Cloud Application with Amazon Lightsail (CMP410-R2) - AWS ...
Deploy and Scale a Cloud Application with Amazon Lightsail (CMP410-R2) - AWS ...
 
Simplifying Microsoft Architectures with AWS Services
Simplifying Microsoft Architectures with AWS Services Simplifying Microsoft Architectures with AWS Services
Simplifying Microsoft Architectures with AWS Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksIntroducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech Talks
 
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
Remove Undifferentiated Heavy Lifting from Jenkins (DEV201-R1) - AWS re:Inven...
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
 

Más de Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

Más de 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...
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 

Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerizing Legacy .NET Workloads Nicki Klein Sr. Technical Evangelist Amazon Web Services Brian Lewis Sr. Solutions Architect Amazon Web Services C O N 3 4 8
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containerize a Legacy ASP.NET app Deploying a .NET app container to Amazon Elastic Container Service (Amazon ECS) Hypervisor Status:on Connections Connections Connections Network Up/NetworkDown Amazon ECS AZ1 AZ2 Private Subnet Public Subnet Internet Gateway Private Subnet Public Subnet NAT GATEWAY NAT GATEWAY ALB Amazon ECS Cluster What we will cover
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Recent AWS .NET related announcements • .NET Developer Center (aws.amazon.com/net)—7/2 • .NET Core 2.1 on Amazon Linux and Ubuntu—7/13 • .NET Core 2.1 on AWS Lambda—7/19 • .NET Global Tools—9/10 • PowerShell for Lambda—9/11 • .NET CDK – 9/13
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Windows deployment modes
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. .Net 4.x requires server core Server 2016 version 1803—server core: •1.58GB, download size, 30% reduction from Windows Server, version 1709 •3.61GB, on disk size, 20% reduction from Windows Server, version 1709 Server version Size on disk Server 2016 – Server Core ~ 8 Gig Serve 2016 version 1709 – Server Core ~4.5 Gig Server 2016 version 1803 - Server Core: ~ 3.6 Gig
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Benefits of Windows containers • Ease of movement (on-prem or in public cloud) • Improve operating system utilization/density • Development/Deployment runtime consistency • Deployment size and speed/use of base images • Server boot times under 1 second
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What’s our sample .NET app? • Sample app circa 2010 • ASP.NET MVC 1.0 • SQL Server Express LocalDB https://github.com/kneekey23/NerdDinner NerdDinner
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WinNat network mode • Similar to bridge mode on Linux • Container have private IP address only accessible from the host • Cannot access exposed ports via localhost
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo: Containerize a legacy ASP.NET appHypervisor Status:on Connections Connections Connections Network Up/NetworkDown Amazon ECS
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Microsoft SQL server in a container Production SQL server container images must be pulled from the Docker store • docker pull microsoft/mssql-server-windows • docker pull microsoft/mssql-server-linux:2017-latest For persistent SQL data: • Use data volume containers • Store the database on a file share (SMB 3.2 suggested) • Mount a host directory as data volume (Linux)
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Volumes for Windows containers • Basic volumes work • Mounting folders—only for folders on the same drive where containers layers are stored • Plugins for volume not yet supported
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo: Containerizing Microsoft SQL serverHypervisor Status:on Connections Connections Connections Network Up/NetworkDown Amazon ECS
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Storing images in Amazon Elastic Container Registry (Amazon ECR) • Amazon ECR Credential Helper for Docker to simplify authentication • Microsoft base layers are not pushed to Amazon ECR by default • Compresses image size by 85-90% before storing in Amazon ECR
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Steps to containerize the legacy .NET app
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Best practice: When building your application, build it in a disposable container and publish in new containers. This will keep the size of your production containers down and reduce the attack surface of the containers.
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS for Windows Server 2016 • Dec 5, 2017—Windows Server containers for production workloads! • ECS-optimized Windows Server 2016 AMI • Includes Docker 17.06 Enterprise Edition • Amazon ECS agent now runs as a native Windows service • Windows containers memory and CPU limit(s) enforcement • PowerShell module can be use to configure Amazon ECS agent • By default, logs are stored in the Windows Event Viewer Windows Server on Amazon ECS:
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS for Windows Server 2016 • Reference architecture on GitHub Step 1. Build ECS cluster https://github.com/aws-samples/ecs- refarch-cloudformation-windows
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS for Windows Server 2016 Step 2. Create task definition
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Task definitions for Windows containers • Most task definition fields of Linux containers work on Windows containers as well • Some task definition fields need changes to Windows specifics such as volume path • Network mode—only WinNAT mode is supported • Container links are not supported • Ulimits field is not supported
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS for Windows Server 2016 • Service name • Number of tasks • Elastic Load Balancing AWS Identity and Access Management (IAM) role Step 3. Create service & launch
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS AZ1 AZ2 Private Subnet Public Subnet Internet Gateway Private Subnet Public Subnet NAT GATEWAY NAT GATEWAY ALB Amazon ECS Cluster Demo:
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Next steps: After you migrate your app Modernizing your .NET apps • Rewriting the application is always the cleanest path • Windows containers offer another option Use Docker to take a feature-driven approach to breaking up the monolithic application, splitting the functionality across multiple containers and using Docker for the plumbing. Use .NET core to extend the application.
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Container Competency—Just announced • APN partners with this designation have a validated product or solution on AWS that supports workloads on containers • These solutions improve customer's ability to leverage containers on AWS • Focus areas include: • Foundation, orchestration, & scheduling • Monitoring & logging • Security • 17 launch partners
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Container Competency launch partners
  • 27. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Code from Demos: https://github.com/kneekey23/NerdDinner Nicki Klein—Technical Evangelist @nicki_23 Brian Lewis—Solutions Architect Want to learn more on .NET and windows containers: Break out session - WIN305 - Containerize Legacy .NET Framework Web Apps for Cloud Migration – Tuesday 27, Nov 2018 4:00 PM – 5:00 PM – Bellagio, Level1, Grand Ballroom2
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.