• No results found

Containerize.NET Apps with Amazon EKS and AWS Fargate

N/A
N/A
Protected

Academic year: 2021

Share "Containerize.NET Apps with Amazon EKS and AWS Fargate"

Copied!
36
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Containerize .NET Apps with Amazon EKS and AWS Fargate

Martin Beeby

W I N 3 0 9

Principal Technical Evangelist Amazon Web Services

(3)

Agenda

What are containers?

What is Docker?

Why containerize .NET?

What is Amazon Elastic Container Registry (Amazon ECR)

Amazon EKS

Amazon ECS

Wrap-up

(4)

For all the pictures go to:

thebeebs.co.uk/inception-slide

Tweet a picture of this slide to @thebeebs

with #inception

A software developer since I was 16

Developer for 20 years

Work at Amazon Web Services

MARTIN BEEBY

(5)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(6)

Containers vs. VMs

App A App B App C

Bins/Libs Bins/Libs Bins/Libs Guest OS Guest OS Guest OS

Hypervisor Server (host)

App A App A App B App B App C App C Bins/Libs Bin/Libs

Container manager (e.g., Docker) Guest OS

Hypervisor

Server (host)

VMs Containers

(7)

Container benefits

Portable runtime application environment

Package application and dependencies in a single artifact

Run different application versions (dev/test/prod, different dependencies) simultaneously

Faster development and deployment cycles

Better resource utilization

(8)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(9)

Docker containerization

Docker – Lightweight container virtualization platform

Provides tools to manage and deploy your applications

Over 80% of containers in 2018 run on Docker

Simplifies creation/management/operation of containers

Built by Docker, Inc.

Licensed under the Apache 2.0 license

(10)

Docker image

Read-only (immutable) base

Docker images built from base image, instructions to add layers on top

Union file systems to combine different layers into a single image

Used to launch container

Instructions stored in Dockerfile

bootfs

kernel Base image

Image Image Container

References parent image Image

(11)

Creating Docker container

2. Docker image 3. Docker container

FROM microsoft/windowsservercore RUN Add-WindowsFeature Web-server RUN Add-WindowsFeature NET-Frame...

COPY myapp /myappfiles 1. Dockerfile

f954msx83nc85b 50 MB k58cxbh48fj490d 300 MB akm34ks9dj5flf9d 500 MB ds8fmdsf895nlks 7 GB

Read/write layer

f954msx83nc85b 50 MB k58cxbh48fj490d 300 MB akm34ks9dj5flf9d 500 MB ds8fmdsf895nlks 7 GB

(12)

Dockerfile

FROM microsoft/dotnet:2.1-sdk-nanoserver-sac2016 AS build WORKDIR /src

COPY QuizUi/QuizUi.csproj QuizUi/

COPY WebApiLib/WebApiClient.csproj WebApiLib/

COPY QuizApiModels/QuizApiModels.csproj QuizApiModels/

COPY . .

WORKDIR /src/QuizUi

RUN dotnet publish QuizUi.csproj -c Release -o /app

FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016 AS final WORKDIR /app

COPY --from=build /app . EXPOSE 80

ENTRYPOINT ["dotnet", "QuizUi.dll"]

(13)

Docker workflow

Pull base image from repository (e.g., Docker Hub)

Build an image from a Dockerfile

Inspect a container

Attach a volume to a container

Run a container

(14)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(15)

Why containers for .NET apps?

Better resource utilization

Deployment/

runtime consistency

Scaling

(16)

Two types of app

.NET Core

(Linux, Windows)

.NET

(Windows)

(17)

Windows container types

Windows Server Core

Support

traditional .NET applications

Nano Server Windows Windows IOT Core

Built for .NET

core applications Provides the full set of Windows APIs

Designed for IOT applications

(18)

Windows container types

Windows Server Core

mcr.microsoft.com/dotnet/framework/aspnet mcr.microsoft.com/dotnet/framework/runtime mcr.microsoft.com/dotnet/framework/wcf

Nano Server

mcr.microsoft.com/dotnet/core/aspnet:3.0 mcr.microsoft.com/dotnet/core/aspnet:2.1

(19)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(20)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(21)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(22)

Fully managed

• Tight integration with Amazon EC

• Integration with Docker toolset

• AWS Management Console and AWS CLI

Highly available

• Amazon S3 backed

• Regional endpoints

Secure

• AWS Identity and Access Management (IAM) resource- based policies

• AWS CloudTrail audit logs

• Images encrypted at transit and at rest

Amazon ECR

(23)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(24)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(25)

Choose your adventure

✓ .NET Core on Linux

✓ .NET Core on Windows

✓ .NET Framework on Windows

Amazon ECS

Amazon ECS

Amazon EKS

✓ .NET Core on Linux

✓ .NET Core on Windows

✓ .NET Framework on Windows

Amazon EKS

(26)
(27)
(28)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(29)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(30)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(31)

Amazon ECS

Fully managed elastic service

Shared-state optimistic scheduling

Deep integration with other AWS services

Amazon Elastic Container Service (Amazon ECS) is a highly scalable, high-performance container

orchestration service that supports

Docker containers and allows you

to run and scale containerized

applications on AWS

(32)

Amazon ECS – EC2 cluster

EC2 instances

AMAZON AGENTECS Task

Container Task

Container

Agent communication service

Amazon ECS

API

Cluster management engine Key/value store AMAZON

AGENTECS Task

Container Task

Container

AMAZON AGENTECS Task

Container Task

Container

Internet balancerLoad

Load balancer

(33)

Amazon ECS: AWS Fargate

AWS Fargate is a technology that you can use with Amazon ECS to run

containers without having to manage servers or clusters of Amazon EC2

instances. With AWS Fargate, you no longer have to provision, configure,

or scale clusters of virtual machines to run containers.

(34)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

(35)

Thank you!

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Martin Beeby

Principal Technical Evangelist

@thebeebs

(36)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

References

Related documents

It utilizes a hosted Hadoop framework running on the web-scale infrastructure of Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3).”..

This service works in close conjunction with Amazon Simple Storage Service (Amazon S3) and Amazon Elastic Compute Cloud (Amazon EC2), collectively providing the ability to store,

This guide shows how to run an Amazon EC2 instance both from the command line and the Web interface, i.e, Amazon Web Service (AWS) Management Console.. Prerequisites • An

Infrastructure As a Service Amazon Simple Storage Service Amazon Elastic Compute Cloud Amazon Simple Queue Service Amazon SimpleDB.. Commerce As a Service Amazon Flexible Payments

The scope of services covered in this report includes AWS CloudHSM, AWS Direct Connect, Amazon DynamoDB, Amazon Elastic Block Store (EBS), Amazon Elastic Cloud Compute (EC2),

Our Cluster Service can also be used to quickly provision and manage other services such as Docker Clusters, Amazon Elastic Kubernetes Service (EKS) and Azure Kubernetes

With templates, you can work with a broad set on AWS offerings, including Amazon Simple Storage Service (Amazon S3), Auto Scaling, Amazon CloudFront, Amazon DynamoDB, Amazon

Amazon Simple Storage Service Amazon Elastic Compute Cloud Amazon Simple Queue Service Amazon SimpleDB.