Containers & Service · Launch using ECS CLI, AWS CLI, or AWS .NET tool for ECS Managed...

Preview:

Citation preview

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Containers & Service

Kirk Davis

Senior Solutions Architect

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Containers

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Linux containers

Linux Kernel

Linux Container

App

Linux Container

App

Container

Runtime

Docker

Engine

containerD

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Windows Server Containers (process containers)

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Windows Hyper-V container vs process container

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Windows Base Container Images

Windows Nanoserver

Windows Server Core

Windows

docker pull mcr.microsoft.com/windows/nanoserver:1909docker pull mcr.microsoft.com/windows/servercore:1909docker pull mcr.microsoft.com/windows:1909

*Current versions are ltsc2019 or 1909

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

• Smallest base layer available for Windows

• Only 64-bit applications

• No graphical applications

• .NET Core

• Only PowerShell Core is available

• PowerShell Core not included by default

(version 1709 onwards)

mcr.microsoft.com/windows/nanoserver

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

• Minimal installation of Windows Server 2016/2019

• Windows PowerShell

• .NET Core & .NET Framework

• No Widows Shell Desktop

• Great for migrating existing Windows applications to

containers

mcr.microsoft.com/windows/servercore

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

• Full installation of Windows Server 2019

• Windows PowerShell

• .NET Core & .NET Framework

• Widows Shell Desktop APIs including DirectX

(but you can’t RDP into it)

• Useful for automating builds and testing that rely on

GUI APIs

mcr.microsoft.com/windows

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

.NET Core container images

Container with .NET Core 3.1 runtime

Container with ASP.NET Core 3.1

Container with .NET Core 3.1 SDK

docker pull mcr.microsoft.com/dotnet/core/runtime:3.1docker pull mcr.microsoft.com/dotnet/core/aspnet:3.1docker pull mcr.microsoft.com/dotnet/core/sdk:3.1

*Current .NET Core version is 3.1

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

.NET Framework vs .NET Core containers

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Container Orchestration Services

Amazon ECS Amazon EKS

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

ECS and ECS comparison

Original AWS container

orchestration service

Supports Linux & Windows

Just docker hosts

Supports Fargate

“serverless containers”

Launch using ECS CLI, AWS

CLI, or AWS .NET tool for ECS

Managed Kubernetes service

introduced in 2018

Supports Linux & Windows

Master node + worker nodes

Supports Fargate “serverless

containers”

Launch using eksctl

Amazon ECS Amazon EKS

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon Elastic Container Registry

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Other topics….

ECS Service Discovery

AWS App Mesh

Running containers in Elastic Beanstalk

Running containers on vanilla EC2

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Serverless

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Operations and management Scaling

Provisioning and utilization Availability and fault tolerance

Owning servers means dealing with ...

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

No servers to provision

or manage

Scales with usage

Never pay for idle Availability and fault

tolerance built in

Benefits of Lambda and serverless compute

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Lambda pricing

• Buy compute time in

100 ms increments

• Low request charge$0.0000002 per request (Ohio)

• No hourly, daily, or

monthly minimums

• No per-device fees

• No paying for idle

Free Tier1 million requests and 400,000 GBs of

compute every month, every customer

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Architecture

Event source

…more Any service

Lambda

Target

Changes in

data state

Requests to

endpoints

Changes in

resource state

C# (.NET Core)

Python

Java

Node.js

Go

Ruby

Custom*

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon DynamoDB

Amazon SNS

Amazon API Gateway

Amazon SQS

Amazon KinesisAmazon S3

Compute and API Proxy

AWS X-Ray

AWS Step Functions

Services for building serverless applications

Database, Storage, Orchestration, Analytics, Interprocess Messaging

Developer Tools

AWS CodeBuild

AWS CodePipelineAWS SAM

Third-Party Tools

Open Source

AWS Lambda AWS Fargate

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Anatomy of a Lambda function

Function to be executed upon

invocation

Data sent during Lambda

function invocation

Methods available to interact

with runtime information

(request ID etc)

Handler() function Event Object Context Object

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Lambda execution models

/api/resource

Synchronous

API Gateway

Lambda Function

Asynchronous

S3

RDS Service

Stream based*

Kinesis Stream

S3 Bucket

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon S3 Amazon

DynamoDB

Amazon

Kinesis

AWS

CloudFormation

AWS CloudTrail Amazon

CloudWatch

Amazon

Cognito

Amazon SNSAmazon

SESCron events

DATA STORES ENDPOINTS

CONFIGURATION REPOSITORIES EVENT/MESSAGE SERVICES

Example event sources that trigger AWS Lambda

And more, with new integrations added all the time

AWS

CodeCommit

Amazon

API Gateway

Amazon

AlexaAWS IoT AWS Step

Functions

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon API Gateway: Serverless APIs

Internet

Mobile Apps

Websites

Services

/api/orders

AWS

API Gateway

Cache

Amazon

CloudWatch

Monitoring

Amazon

CloudFront Amazon

API Gateway

/api/catalog

/api/cart

/api/inventory

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Lambda layers

Centrally manage code and data that is shared across multiple functions.

Keep deployment packages small, and avoid errors that can occur when you install

and package dependencies with your function code.

A layer is a ZIP archive that contains libraries, a custom runtime, or other

dependencies.

.NET support for Lambda layers is enabled by the

Amazon.Lambda.Tools NuGet package (.NET Core Global Tool)

Allows you to create and inspect layers, and deploy layer-aware functions

Using layers enables you to pre-JIT the platform-agnostic MSIL into native machine

code, significantly reducing cold-start times! (Requires publishing the layer from an

Amazon Linux AMI EC2 instance)

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Custom Runtime support

Use your own runtime within a Lambda function.

Craft and use languages and custom runtimes not provided by AWS

Distribute custom runtimes as Layers if desired

Opens up Lambda to almost any language or customized runtime

environment

.NET support for custom runtimes is enabled by the

Amazon.Lambda.RuntimeSupport NuGet package

Allows you to specify custom .NET Core versions (for 3.0, preview, etc)

AWS also provides reference implementations for C++ and Rust

https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Thank you!

Recommended