SlideShare ist ein Scribd-Unternehmen logo
1 von 85
Downloaden Sie, um offline zu lesen
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Re Alvarez Parmar, @realz
Solutions Architect, Amazon Web Services
Deep Dive on AWS Fargate
SRV314
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
A little bit of intro
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
A container is an atomic, self-contained package of
software that includes everything it needs to run (code,
runtime, libraries, packages, etc.).
A popular, widely used container platform is Docker.
More on that here: https://docker.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why are containers so popular?
• Portable
• Lightweight
• Standardized
• Easy to deploy
• Along with containers, comes the “monolith to microservices”
story: containers and microservices go hand in hand
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
OK, so what are microservices?
”Service-oriented architecture
composed of loosely coupled elements
that have bounded contexts.”
- Adrian Cockroft
This is Adrian
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why do containers and microservices go together?
• One job, one service → container
• Can deploy and scale containers
independently
• This means that a high traffic service, like a
messaging service, might need to be scaled
frequently, but a low traffic service, like an
internal dashboard, doesn’t need to be
scaled at the same time
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managing one container is easy(ish)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managing many containers is much harder
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enter orchestration tools
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Orchestration tools help us deploy, manage, and
scale our containers, so we don’t need to do all the
heavy lifting ourselves.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
There are a few options on AWS for
container orchestration
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s recap the container options
on AWS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What does the landscape look like all together?
Amazon ECS
(available now)
Amazon EKS
(available now)
Fargate mode for
Amazon ECS
(available now)
Fargate mode for
Amazon EKS
(coming soon)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MANAGEMENT
Deployment, Scheduling, Scaling
& Management
HOSTING
Where the containers run
Amazon EC2
IMAGE REGISTRY
Container Image Repository
What are the services for?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AMAZON CONTAINER SERVICES
So you want to run a (managed) container on AWS
Choose your orchestration tool1
Choose your launch type2
ECS EKS
EC2 Fargate EC2 Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
OK, so let’s talk about AWS Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Your Docker
Containers
NO INSTANCES TO MANAGE
No EC2 instances to provision, scale or manage
ELASTIC
Scale up & down seamlessly. Pay only for what you use
INTEGRATED
with the AWS ecosystem: VPC networking,
Elastic Load Balancing, IAM permissions, Amazon
CloudWatch, and more.
AWS FARGATE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Huh?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Remember this?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
S
e
r
v
e
r
G
u
e
s
t
O
S
Running one container is easy…
Managing many containers is hard
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scheduling and Orchestration
Cluster Manager Placement Engine
Availability Zone #1 Availability Zone #2 Availability Zone #3
Amazon ECS makes it easier
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Elastic Container Service (Amazon ECS)
Easiest way to deploy and
manage containers!
Integration with entire AWS platform
ALB, Auto Scaling, AWS Batch, Elastic Beanstalk, AWS
CloudFormation, AWS CloudTrail, Amazon CloudWatch Events,
Amazon CloudWatch Logs, CloudWatch metrics, Amazon ECR, EC2
Spot, IAM, NLB, Parameter Store, Amazon Route 53, and VPC
Scales to support clusters of any size
Service integrations (like ALB and NLB) are at container
level
1
2
3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
But not totally hands off
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fargate lets you focus on your application
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“When someone asks you for a sandwich, they
aren’t asking you to put them in charge of a global
sandwich logistic chain. They just want a
sandwich.”
P.S., the sandwich is
Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
And people are using it!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Entire website runs as microservices. Ruby &
GraphQL backend with Node.js front end
Needed ability to scale quickly, schedule multi-container
workloads, network layer control
All in on AWS—Moved entire infrastructure to AWS and
Fargate in Jan 2018
Fargate scales quickly with traffic spikes, making it easy to
handle new announcements and viral campaigns
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Public
Subnet
Private
Subnet
CDN
External
ALB
Backend Web External
API External
Front End Web
External
Card/Scraper
Service
Background
Job Queues
Background
Workers
Internal
ALB Background Web
Internal
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“We moved to AWS Fargate because we
need the ability to scale quickly up from
baseline, run multi-container workloads,
and get fine-grained network control,
without having to manage our own
infrastructure.”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Fargate Customers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s get deeper: the easiest way to think about
AWS Fargate is in comparison to Amazon ECS in EC2
mode.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Instances: standard
EC2 boxes. Once
registered to a
Cluster, your Tasks
run here
Services: layer that
manages and
places tasks
Tasks: container wrapper
and configuration around
processes running on the
instance
How do the pieces of Amazon ECS map to traditional
workloads?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Instances Services Tasks
So what are you responsible for with Amazon ECS?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• In EC2 mode, you’re responsible for configuring all three of those pieces: instances,
services, and tasks.
• Instances are configured through the ECS-optimized AMI (or your own AMI), and/or
you can configure with EC2 user-data
• Services and Tasks (and containers) are all configured through the ECS API, which
you can either access directly, or go through the CLI. Tasks are defined through task
definitions, and containers are defined through container definitions.
So what are you responsible for with Amazon ECS?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Choose your own instance type, with any combination of resources
• Controlled through the Service ASG launch configuration, like with any other EC2
cluster.
• Supports GPUs, spot instances, RIs, etc.
How does compute work in ECS?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Got it? Fargate has some similarities and
differences.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Same Task
Definition schema
Use ECS APIs to
launch Fargate
containers
Easy migration –
Run Fargate and
EC2 launch type
tasks in the same
cluster
Share primitives
like VPC,
CloudWatch, IAM
with Amazon ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Instances Services Tasks
So what are you responsible for with AWS Fargate?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• In EC2 mode, you’re responsible for configuring services and tasks
• Instances are not configured by you; you can ONLY configure at the container/task
level
• Services and tasks (and containers) are all configured through the ECS API, which you
can either access directly, or go through the CLI. Tasks are defined through task
definitions, and containers are defined through container definitions.
What are you responsible for with AWS Fargate?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How does compute work in AWS Fargate?
CPU Memory
256 (.25 vCPU) 512 MB, 1 GB, 2 GB
512 (.5 vCPU) 1 GB, 2 GB, 3 GB, 4 GB
1024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB
2048 (2 vCPU) Between 4 GB and 16 GB in 1 GB increments
4096 (4 vCPU) Between 8 GB and 30 GB in 1 GB increments
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do you know what to choose?
Depends on your workload.
Fargate: if you can configure with just a task definition, and you’re ok with AWS VPC
networking mode, try AWS Fargate. Some caveats: can’t exec into the container, or
access the underlying host (this is also a good thing)
EC2 mode: good if you need to customize!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s get more specific
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scorekeep App
A TicTacToe game application, called Scorekeep on Fargate
Front End Server
Container
Angular + Nginx
API Server
Container
Java
Internet
Port
8080
Port
5000
Load balancer
Amazon
DynamoDB
Amazon
SNS
Configure it step by step : Compute, Networking, Storage, Permissions, Logging, and run it!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fargate constructs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define application containers: Image URL, CPU &
Memory requirements, etc.
register
Task Definition
create
Cluster
• Infrastructure Isolation boundary
• IAM Permissions boundary
run
Task
• A running instantiation of a task
definition
• Use FARGATE launch type
create
Service
Elastic Load
Balancer
• Maintain n running copies
• Integrated with ELB
• Unhealthy tasks automatically
replaced
Constructs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Task Definition
{
"family": “scorekeep",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-
1.amazonaws.com/fe"
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-
1.amazonaws.com/api"
}
]
}
• Immutable, versioned document
• Identified by family:version
• Contains a list of up to 10 container
definitions
• All containers are colocated on the same
host
• Each container definition has:
• A name
• Image URL (ECR or Public Images)
• And more…stay tuned!
Task Definition Snippet
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Registry support
Public Repositories
Amazon Elastic Container Registry (Amazon ECR)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Setting compute resources with Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-
1.amazonaws.com/fe“,
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-
1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
Units
• CPU : cpu-units. 1 vCPU = 1024 cpu-units
• Memory : MB
Task Level Resources:
• Total CPU/Memory across all containers
• Required fields
• Billing axis
Container Level Resources:
• Defines sharing of task resources among containers
• Optional fields
Task Level
Resources
Container
Level
Resources
Task Definition Snippet
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pricing
Per-second billing. 1 minute minimum
Pay for what you provision
Billed for Task level CPU and Memory
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fargate Networking
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Traditional Docker networking
Bridge: docker0. This is the default behavior. Containers on the same
network can communicate via IP address. No automatic service discovery.
Connect containers with ---link
None: no network interface, only local loopback (which I’ll explain shortly)
Host: connect to host network (container maps to host)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC integration with Fargate
172.31.0.0/16
Subnet
172.31.1.0/24
Internet
Other Entities in VPC
EC2 LB DB etc.
Private IP
172.31.1.164
Launch your Fargate Tasks into subnets
Under the hood:
• We create an elastic network interface
• The elastic network interface is allocated a private IP
from your subnet
• The elastic network interface is attached to your task
• Your task now has a private IP from your subnet!
You can assign public IPs to your tasks
Configure security groups to control inbound & outbound
traffic
ENI Fargate
TaskPublic /
208.57.73.13 /
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC configuration
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
$ aws ecs run-task ...
-- task-definition scorekeep:1
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet1-id, subnet2-id],
securityGroups=[sg-id]
}”
Enables ENI creation &
attachment to Task Run Task
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Load Balancing configuration
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": “awsvpc“,
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
$ aws ecs create-service ...
-- task-definition scorekeep:1
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet-id],
securityGroups=[sg-id]
}”
-- load-balancers
“[
{
"targetGroupArn": “<insert arn>",
"containerName": “scorekeep-frontend",
"containerPort": 8080
}
]”
Create Service
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Here’s an example of an internet facing ELB setup
Public subnet Private subnet
Fargate
TaskENI
Private IP
172.31.1.164
:8080
ALB
Public IP
208.57.73.13
:80
172.31.0.0/16
172.31.2.0/24 172.31.1.0/24
Internet
Task in private subnet with private IP
ALB in public subnet with public IP
Make sure the AZs of the two subnets match
ALB security group to allow inbound traffic from
internet
Task security group to allow inbound traffic
from the ALB’s security group
Task Security GroupALB Security Group
Type Port Source
HTTP 80 0.0.0.0/0
Inbound Rule
Type Port Source
Custom TCP 8080 ALB Security Group
Inbound Rule
us-east-1a us-east-1a
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Disk storage
EBS backed Ephemeral storage provided in the form of:
Volume Storage
Writable Layer Storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Layer storage
• Docker images are composed of layers
The topmost layer is the “writable” layer to
capture file changes made by the running
container
• 10 GB Layer storage available per task, across
all containers, including image layers
• Writes are not visible across containers
• Ephemeral. Storage is not available after the
task stops.
Image Layers
Writable Layer
Image Layers
Writable Layer
Container 1 Container 2
10 GB per Task
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Volume storage
• Need writes to be visible across
containers?
• Fargate provides 4 GB volume space per
task
• Configure via volume mounts in task
definition
• Can mount at different containerPaths
• Do not specify host sourcePath
• Remember this is also ephemeral, i.e., not
available after the task stops
Container 1 Container 2
4 GB Volume Storage
mount
/var/container1/data /var/container2/data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IAM permissions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Types of permissions
Cluster
Permissions
Application
Permissions
Task
Housekeeping
Permissions
Cluster
Fargate Task
Cluster Permissions:
Control who can launch/describe tasks in your cluster
Application Permissions:
Allows your application containers to access AWS
resources securely
Housekeeping Permissions:
Allows us to perform housekeeping activities around your
task:
• ECR Image Pull
• CloudWatch Logs pushing
• ENI creation
• Register/Deregister targets into ELB
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Visibility and monitoring
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudWatch Logs configuration
• Use the awslogs driver to send
stdout from your application to
CloudWatch Logs
• Create a log group in
CloudWatch
• Configure the log driver in your
task definition
• Remember to add permissions
via the Task Execution Role
{
"family": "scorekeep",
...
"containerDefinitions": [
{
"name":“scorekeep-frontend",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "scorekeep/frontend“}}
},
{
"name":“scorekeep-api",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "scorekeep/api"}}
}
]}
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudWatch Logs
Logs Tab in the
Task Detail Page
View logs in the Amazon ECS or CloudWatch console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Other visibility tools
Service CPU/Memory utilization metrics
available in CloudWatch
CloudWatch Events on task state changes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scorekeep Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode":"awsvpc",
"taskRoleArn": "arn:aws:…",
"executionRoleArn": “arn:…”,
"requiresCompatibilities": [
"FARGATE"
],
"containerDefinitions": […]
}
{
"name": "scorekeep-frontend",
"image":“xxx.dkr.ecr…frontend",
"cpu": 256,
"memoryReservation": 512,
"portMappings" : [
{ "containerPort": 8080 }
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix":
"scorekeep/frontend"
}
}
}
{
"name": "scorekeep-api",
"image":“xxx.dkr.ecr…api",
"cpu": 768,
"memoryReservation": 512,
"portMappings" : [
{ "containerPort": 5000 }
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix":
"scorekeep/api”
}
},
"environment": […] #env var
}
Final scorekeep task definition
Task Definition scorekeep-frontend
Container Definition
scorekeep-api
Container Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Find the Fargate Scorekeep project on GitHub at
github.com/awslabs/eb-java-scorekeep/tree/fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What did we learn about Fargate?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Fargate is a new launch type within Amazon ECS to run containers without having to manage EC2 instances
• If you’re debating between EC2 v/s Fargate mode, start architecting with Fargate.
It forces good design practice by keeping your application containers truly independent
of the underlying host.
• If you think you must have access to the underlying host, think again.
• There are some good reasons : special instance type needs, EC2 dedicated instances, utilizing EC2
reserved instances
• And tell us about your use case, we want to support it on Fargate!
• Start using Fargate today!
• Fargate works with most Docker container images
• You can run existing task definitions on Fargate with only minor modifications.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS: can be totally managed, or can customize resource usage, networking, task
placement etc. to fit your application needs. Shared responsibility with AWS (because managed
service). ecs-agent is open source. Easy integration with other AWS services.
Amazon EKS: managed, upstream Kubernetes. Can connect to clusters through kubectl and use
existing tooling. Can opt in to managed version upgrades. Add resources to your cluster through
EC2 (now), or with Fargate mode (2018).
Fargate: underlying technology for containers on demand. Pass a task definition or Kubernetes
Pod, set resource limits, and Fargate manages everything else. NO access to underlying host, no
managing of resources. Great if you don’t want to handle scaling, orchestration, deployments,
upgrades yourself. Not for those of you that are making changes to your infrastructure (i.e.,
bringing custom AMIs, or installing things through EC2 user-data)
tl;dr
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Did you say you like CLI?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CLIs (that I know of) for Fargate/ECS:
aws-cli: Open source, includes most AWS services.
• More info here: https://aws.amazon.com/cli/
• GitHub here: https://github.com/aws/aws-cli
ecs-cli: also official, but just for ECS. Supports docker compose files.
• More info here: https://github.com/aws/amazon-ecs-cli
Some good unofficial options:
Fargate CLI: https://github.com/jpignata/fargate
Coldbrew CLI: https://github.com/coldbrewcloud/coldbrew-cli
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What’s Next?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We want to hear from all of you!
More focus on supporting Tasks as compute primitive, more
focus on removing undifferentiated heavy lifting.
Our roadmap is driven by feedback:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How can I get started?
• To get started with Fargate: https://aws.amazon.com/fargate/
• Blogs: https://aws.amazon.com/blogs/aws/aws-fargate/
• https://aws.amazon.com/blogs/aws/amazon-elastic-container-service-for-kubernetes/
• Liz Rice from Aquasec on Fargate: https://blog.aquasec.com/securing-struts-in-aws-fargate
• Nathan Peck from AWS: https://medium.com/containers-on-aws/choosing-your-container-environment-on-
aws-with-ecs-eks-and-fargate-cfbe416ab1a
• Deepak Singh (containers GM at AWS): https://www.slideshare.net/AmazonWebServices/containers-on-
aws-state-of-the-union-con201-reinvent-2017
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The awesome-ecs project:
https://github.com/nathanpeck/awesome-
ecs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workshops!
From @brentcontained
https://t.co/ba0usbZqHN
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Need a little help?
Community Slack channels:
awsdevelopers.slack.com
amazon-ecs.slack.com
Or reach out to one of us directly:
@abbyfuller or abbyfull@amazon.com
@nathankpeck
@brentcontained
@paulmaddox
@ric_harvey
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Go build (and tell us about it)!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Submit session feedback
1. Tap the Schedule icon.
2. Select the session you attended.
3. Tap Session Evaluation to submit your
feedback.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thanks!
@realz
N E W Y O R K

Weitere ähnliche Inhalte

Was ist angesagt?

20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMRAmazon Web Services Japan
 
AWS Well-Architected Security とベストプラクティス
AWS Well-Architected Security とベストプラクティスAWS Well-Architected Security とベストプラクティス
AWS Well-Architected Security とベストプラクティスAmazon Web Services Japan
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / GlacierAmazon Web Services Japan
 
20210317 AWS Black Belt Online Seminar Amazon MQ
20210317 AWS Black Belt Online Seminar Amazon MQ 20210317 AWS Black Belt Online Seminar Amazon MQ
20210317 AWS Black Belt Online Seminar Amazon MQ Amazon Web Services Japan
 
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
20190326 AWS Black Belt Online Seminar Amazon CloudWatch20190326 AWS Black Belt Online Seminar Amazon CloudWatch
20190326 AWS Black Belt Online Seminar Amazon CloudWatchAmazon Web Services Japan
 
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門Amazon Web Services Japan
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したことAmazon Web Services Japan
 
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...Amazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon Kinesis
AWS Black Belt Techシリーズ  Amazon KinesisAWS Black Belt Techシリーズ  Amazon Kinesis
AWS Black Belt Techシリーズ Amazon KinesisAmazon Web Services Japan
 
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration Service20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration ServiceAmazon Web Services Japan
 
20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway 20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway Amazon Web Services Japan
 
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用Amazon Web Services Japan
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要Amazon Web Services Japan
 
20200812 AWS Black Belt Online Seminar Amazon Macie
20200812 AWS Black Belt Online Seminar Amazon Macie20200812 AWS Black Belt Online Seminar Amazon Macie
20200812 AWS Black Belt Online Seminar Amazon MacieAmazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAmazon Web Services Japan
 
AWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load BalancingAWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load BalancingAmazon Web Services Japan
 
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...Amazon Web Services Japan
 
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...Amazon Web Services Japan
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@EdgeAmazon Web Services Japan
 

Was ist angesagt? (20)

20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR
 
AWS Well-Architected Security とベストプラクティス
AWS Well-Architected Security とベストプラクティスAWS Well-Architected Security とベストプラクティス
AWS Well-Architected Security とベストプラクティス
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
 
20210317 AWS Black Belt Online Seminar Amazon MQ
20210317 AWS Black Belt Online Seminar Amazon MQ 20210317 AWS Black Belt Online Seminar Amazon MQ
20210317 AWS Black Belt Online Seminar Amazon MQ
 
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
20190326 AWS Black Belt Online Seminar Amazon CloudWatch20190326 AWS Black Belt Online Seminar Amazon CloudWatch
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
 
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと
 
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
 
20170621 aws-black belt-ads-sms
20170621 aws-black belt-ads-sms20170621 aws-black belt-ads-sms
20170621 aws-black belt-ads-sms
 
AWS Black Belt Techシリーズ Amazon Kinesis
AWS Black Belt Techシリーズ  Amazon KinesisAWS Black Belt Techシリーズ  Amazon Kinesis
AWS Black Belt Techシリーズ Amazon Kinesis
 
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration Service20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
 
20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway 20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway
 
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
 
20200812 AWS Black Belt Online Seminar Amazon Macie
20200812 AWS Black Belt Online Seminar Amazon Macie20200812 AWS Black Belt Online Seminar Amazon Macie
20200812 AWS Black Belt Online Seminar Amazon Macie
 
AWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon Kinesis
 
AWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load BalancingAWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load Balancing
 
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
 
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...
20191002 AWS Black Belt Online Seminar Amazon EC2 Auto Scaling and AWS Auto S...
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
 

Ähnlich wie Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit

Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...Amazon Web Services
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Amazon Web Services
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Amazon Web Services
 
Getting-started-with-containers on AWS
Getting-started-with-containers on AWSGetting-started-with-containers on AWS
Getting-started-with-containers on AWSAmazon Web Services
 
Containers State of the Union I AWS Dev Day 2018
Containers State of the Union I AWS Dev Day 2018Containers State of the Union I AWS Dev Day 2018
Containers State of the Union I AWS Dev Day 2018AWS Germany
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWSAmazon Web Services
 
Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Amazon Web Services
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less OperationsDonnie Prakoso
 
AWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAmazon Web Services
 
Building with Containers on AWS by Tony Pujals .pdf
Building with Containers on AWS by Tony Pujals .pdfBuilding with Containers on AWS by Tony Pujals .pdf
Building with Containers on AWS by Tony Pujals .pdfAmazon Web Services
 
Usare la tecnologia Container su AWS
Usare la tecnologia Container su AWSUsare la tecnologia Container su AWS
Usare la tecnologia Container su AWSAmazon Web Services
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteArun Gupta
 
Containers on AWS - State of the Union
Containers on AWS - State of the UnionContainers on AWS - State of the Union
Containers on AWS - State of the UnionAWS Germany
 
Using Containers and Serverless to Deploy Microservices
Using Containers and Serverless to Deploy MicroservicesUsing Containers and Serverless to Deploy Microservices
Using Containers and Serverless to Deploy MicroservicesAmazon Web Services
 
Containers-AWS-Webinar-13-11-2018.pdf
Containers-AWS-Webinar-13-11-2018.pdfContainers-AWS-Webinar-13-11-2018.pdf
Containers-AWS-Webinar-13-11-2018.pdfAmazon Web Services
 

Ähnlich wie Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit (20)

Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate
 
Containers - State of the Union
Containers - State of the UnionContainers - State of the Union
Containers - State of the Union
 
Containers - State of the Union
Containers - State of the UnionContainers - State of the Union
Containers - State of the Union
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
 
Deep dive - AWS Fargate
Deep dive - AWS FargateDeep dive - AWS Fargate
Deep dive - AWS Fargate
 
Getting-started-with-containers on AWS
Getting-started-with-containers on AWSGetting-started-with-containers on AWS
Getting-started-with-containers on AWS
 
Containers State of the Union I AWS Dev Day 2018
Containers State of the Union I AWS Dev Day 2018Containers State of the Union I AWS Dev Day 2018
Containers State of the Union I AWS Dev Day 2018
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
 
Using Containers on AWS
Using Containers on AWSUsing Containers on AWS
Using Containers on AWS
 
Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less Operations
 
AWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern Applications
 
Building with Containers on AWS by Tony Pujals .pdf
Building with Containers on AWS by Tony Pujals .pdfBuilding with Containers on AWS by Tony Pujals .pdf
Building with Containers on AWS by Tony Pujals .pdf
 
Usare la tecnologia Container su AWS
Usare la tecnologia Container su AWSUsare la tecnologia Container su AWS
Usare la tecnologia Container su AWS
 
Amazon Container Services
Amazon Container ServicesAmazon Container Services
Amazon Container Services
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
 
Containers on AWS - State of the Union
Containers on AWS - State of the UnionContainers on AWS - State of the Union
Containers on AWS - State of the Union
 
Using Containers and Serverless to Deploy Microservices
Using Containers and Serverless to Deploy MicroservicesUsing Containers and Serverless to Deploy Microservices
Using Containers and Serverless to Deploy Microservices
 
Containers-AWS-Webinar-13-11-2018.pdf
Containers-AWS-Webinar-13-11-2018.pdfContainers-AWS-Webinar-13-11-2018.pdf
Containers-AWS-Webinar-13-11-2018.pdf
 

Mehr von Amazon Web Services

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

Mehr von Amazon Web Services (20)

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

Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Re Alvarez Parmar, @realz Solutions Architect, Amazon Web Services Deep Dive on AWS Fargate SRV314
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. A little bit of intro
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. A container is an atomic, self-contained package of software that includes everything it needs to run (code, runtime, libraries, packages, etc.). A popular, widely used container platform is Docker. More on that here: https://docker.com
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why are containers so popular? • Portable • Lightweight • Standardized • Easy to deploy • Along with containers, comes the “monolith to microservices” story: containers and microservices go hand in hand
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. OK, so what are microservices? ”Service-oriented architecture composed of loosely coupled elements that have bounded contexts.” - Adrian Cockroft This is Adrian
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why do containers and microservices go together? • One job, one service → container • Can deploy and scale containers independently • This means that a high traffic service, like a messaging service, might need to be scaled frequently, but a low traffic service, like an internal dashboard, doesn’t need to be scaled at the same time
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managing one container is easy(ish)
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managing many containers is much harder Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Enter orchestration tools
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Orchestration tools help us deploy, manage, and scale our containers, so we don’t need to do all the heavy lifting ourselves.
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. There are a few options on AWS for container orchestration
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s recap the container options on AWS
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What does the landscape look like all together? Amazon ECS (available now) Amazon EKS (available now) Fargate mode for Amazon ECS (available now) Fargate mode for Amazon EKS (coming soon)
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. MANAGEMENT Deployment, Scheduling, Scaling & Management HOSTING Where the containers run Amazon EC2 IMAGE REGISTRY Container Image Repository What are the services for?
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AMAZON CONTAINER SERVICES So you want to run a (managed) container on AWS Choose your orchestration tool1 Choose your launch type2 ECS EKS EC2 Fargate EC2 Fargate
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. OK, so let’s talk about AWS Fargate
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Your Docker Containers NO INSTANCES TO MANAGE No EC2 instances to provision, scale or manage ELASTIC Scale up & down seamlessly. Pay only for what you use INTEGRATED with the AWS ecosystem: VPC networking, Elastic Load Balancing, IAM permissions, Amazon CloudWatch, and more. AWS FARGATE
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Huh?
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Remember this?
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S S e r v e r G u e s t O S Running one container is easy… Managing many containers is hard
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scheduling and Orchestration Cluster Manager Placement Engine Availability Zone #1 Availability Zone #2 Availability Zone #3 Amazon ECS makes it easier
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Elastic Container Service (Amazon ECS) Easiest way to deploy and manage containers! Integration with entire AWS platform ALB, Auto Scaling, AWS Batch, Elastic Beanstalk, AWS CloudFormation, AWS CloudTrail, Amazon CloudWatch Events, Amazon CloudWatch Logs, CloudWatch metrics, Amazon ECR, EC2 Spot, IAM, NLB, Parameter Store, Amazon Route 53, and VPC Scales to support clusters of any size Service integrations (like ALB and NLB) are at container level 1 2 3
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. But not totally hands off
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fargate lets you focus on your application
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. “When someone asks you for a sandwich, they aren’t asking you to put them in charge of a global sandwich logistic chain. They just want a sandwich.” P.S., the sandwich is Fargate
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. And people are using it!
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Entire website runs as microservices. Ruby & GraphQL backend with Node.js front end Needed ability to scale quickly, schedule multi-container workloads, network layer control All in on AWS—Moved entire infrastructure to AWS and Fargate in Jan 2018 Fargate scales quickly with traffic spikes, making it easy to handle new announcements and viral campaigns
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Public Subnet Private Subnet CDN External ALB Backend Web External API External Front End Web External Card/Scraper Service Background Job Queues Background Workers Internal ALB Background Web Internal
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. “We moved to AWS Fargate because we need the ability to scale quickly up from baseline, run multi-container workloads, and get fine-grained network control, without having to manage our own infrastructure.”
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Fargate Customers
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s get deeper: the easiest way to think about AWS Fargate is in comparison to Amazon ECS in EC2 mode.
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instances: standard EC2 boxes. Once registered to a Cluster, your Tasks run here Services: layer that manages and places tasks Tasks: container wrapper and configuration around processes running on the instance How do the pieces of Amazon ECS map to traditional workloads?
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instances Services Tasks So what are you responsible for with Amazon ECS?
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • In EC2 mode, you’re responsible for configuring all three of those pieces: instances, services, and tasks. • Instances are configured through the ECS-optimized AMI (or your own AMI), and/or you can configure with EC2 user-data • Services and Tasks (and containers) are all configured through the ECS API, which you can either access directly, or go through the CLI. Tasks are defined through task definitions, and containers are defined through container definitions. So what are you responsible for with Amazon ECS?
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Choose your own instance type, with any combination of resources • Controlled through the Service ASG launch configuration, like with any other EC2 cluster. • Supports GPUs, spot instances, RIs, etc. How does compute work in ECS?
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Got it? Fargate has some similarities and differences.
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Same Task Definition schema Use ECS APIs to launch Fargate containers Easy migration – Run Fargate and EC2 launch type tasks in the same cluster Share primitives like VPC, CloudWatch, IAM with Amazon ECS
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instances Services Tasks So what are you responsible for with AWS Fargate?
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • In EC2 mode, you’re responsible for configuring services and tasks • Instances are not configured by you; you can ONLY configure at the container/task level • Services and tasks (and containers) are all configured through the ECS API, which you can either access directly, or go through the CLI. Tasks are defined through task definitions, and containers are defined through container definitions. What are you responsible for with AWS Fargate?
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How does compute work in AWS Fargate? CPU Memory 256 (.25 vCPU) 512 MB, 1 GB, 2 GB 512 (.5 vCPU) 1 GB, 2 GB, 3 GB, 4 GB 1024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB 2048 (2 vCPU) Between 4 GB and 16 GB in 1 GB increments 4096 (4 vCPU) Between 8 GB and 30 GB in 1 GB increments
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do you know what to choose? Depends on your workload. Fargate: if you can configure with just a task definition, and you’re ok with AWS VPC networking mode, try AWS Fargate. Some caveats: can’t exec into the container, or access the underlying host (this is also a good thing) EC2 mode: good if you need to customize!
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s get more specific
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scorekeep App A TicTacToe game application, called Scorekeep on Fargate Front End Server Container Angular + Nginx API Server Container Java Internet Port 8080 Port 5000 Load balancer Amazon DynamoDB Amazon SNS Configure it step by step : Compute, Networking, Storage, Permissions, Logging, and run it!
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fargate constructs
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define application containers: Image URL, CPU & Memory requirements, etc. register Task Definition create Cluster • Infrastructure Isolation boundary • IAM Permissions boundary run Task • A running instantiation of a task definition • Use FARGATE launch type create Service Elastic Load Balancer • Maintain n running copies • Integrated with ELB • Unhealthy tasks automatically replaced Constructs
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Task Definition { "family": “scorekeep", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east- 1.amazonaws.com/fe" }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east- 1.amazonaws.com/api" } ] } • Immutable, versioned document • Identified by family:version • Contains a list of up to 10 container definitions • All containers are colocated on the same host • Each container definition has: • A name • Image URL (ECR or Public Images) • And more…stay tuned! Task Definition Snippet
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Registry support Public Repositories Amazon Elastic Container Registry (Amazon ECR)
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Setting compute resources with Fargate
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east- 1.amazonaws.com/fe“, "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east- 1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } Units • CPU : cpu-units. 1 vCPU = 1024 cpu-units • Memory : MB Task Level Resources: • Total CPU/Memory across all containers • Required fields • Billing axis Container Level Resources: • Defines sharing of task resources among containers • Optional fields Task Level Resources Container Level Resources Task Definition Snippet
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pricing Per-second billing. 1 minute minimum Pay for what you provision Billed for Task level CPU and Memory
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fargate Networking
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Traditional Docker networking Bridge: docker0. This is the default behavior. Containers on the same network can communicate via IP address. No automatic service discovery. Connect containers with ---link None: no network interface, only local loopback (which I’ll explain shortly) Host: connect to host network (container maps to host)
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC integration with Fargate 172.31.0.0/16 Subnet 172.31.1.0/24 Internet Other Entities in VPC EC2 LB DB etc. Private IP 172.31.1.164 Launch your Fargate Tasks into subnets Under the hood: • We create an elastic network interface • The elastic network interface is allocated a private IP from your subnet • The elastic network interface is attached to your task • Your task now has a private IP from your subnet! You can assign public IPs to your tasks Configure security groups to control inbound & outbound traffic ENI Fargate TaskPublic / 208.57.73.13 /
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC configuration { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": "awsvpc", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } $ aws ecs run-task ... -- task-definition scorekeep:1 -- network-configuration “awsvpcConfiguration = { subnets=[subnet1-id, subnet2-id], securityGroups=[sg-id] }” Enables ENI creation & attachment to Task Run Task Task Definition
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Load Balancing configuration { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": “awsvpc“, "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } $ aws ecs create-service ... -- task-definition scorekeep:1 -- network-configuration “awsvpcConfiguration = { subnets=[subnet-id], securityGroups=[sg-id] }” -- load-balancers “[ { "targetGroupArn": “<insert arn>", "containerName": “scorekeep-frontend", "containerPort": 8080 } ]” Create Service Task Definition
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Here’s an example of an internet facing ELB setup Public subnet Private subnet Fargate TaskENI Private IP 172.31.1.164 :8080 ALB Public IP 208.57.73.13 :80 172.31.0.0/16 172.31.2.0/24 172.31.1.0/24 Internet Task in private subnet with private IP ALB in public subnet with public IP Make sure the AZs of the two subnets match ALB security group to allow inbound traffic from internet Task security group to allow inbound traffic from the ALB’s security group Task Security GroupALB Security Group Type Port Source HTTP 80 0.0.0.0/0 Inbound Rule Type Port Source Custom TCP 8080 ALB Security Group Inbound Rule us-east-1a us-east-1a
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Storage
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Disk storage EBS backed Ephemeral storage provided in the form of: Volume Storage Writable Layer Storage
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Layer storage • Docker images are composed of layers The topmost layer is the “writable” layer to capture file changes made by the running container • 10 GB Layer storage available per task, across all containers, including image layers • Writes are not visible across containers • Ephemeral. Storage is not available after the task stops. Image Layers Writable Layer Image Layers Writable Layer Container 1 Container 2 10 GB per Task
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Volume storage • Need writes to be visible across containers? • Fargate provides 4 GB volume space per task • Configure via volume mounts in task definition • Can mount at different containerPaths • Do not specify host sourcePath • Remember this is also ephemeral, i.e., not available after the task stops Container 1 Container 2 4 GB Volume Storage mount /var/container1/data /var/container2/data
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. IAM permissions
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Types of permissions Cluster Permissions Application Permissions Task Housekeeping Permissions Cluster Fargate Task Cluster Permissions: Control who can launch/describe tasks in your cluster Application Permissions: Allows your application containers to access AWS resources securely Housekeeping Permissions: Allows us to perform housekeeping activities around your task: • ECR Image Pull • CloudWatch Logs pushing • ENI creation • Register/Deregister targets into ELB
  • 65. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Visibility and monitoring
  • 66. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch Logs configuration • Use the awslogs driver to send stdout from your application to CloudWatch Logs • Create a log group in CloudWatch • Configure the log driver in your task definition • Remember to add permissions via the Task Execution Role { "family": "scorekeep", ... "containerDefinitions": [ { "name":“scorekeep-frontend", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "scorekeep/frontend“}} }, { "name":“scorekeep-api", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "scorekeep/api"}} } ]} Task Definition
  • 67. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch Logs Logs Tab in the Task Detail Page View logs in the Amazon ECS or CloudWatch console
  • 68. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Other visibility tools Service CPU/Memory utilization metrics available in CloudWatch CloudWatch Events on task state changes
  • 69. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scorekeep Task Definition
  • 70. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode":"awsvpc", "taskRoleArn": "arn:aws:…", "executionRoleArn": “arn:…”, "requiresCompatibilities": [ "FARGATE" ], "containerDefinitions": […] } { "name": "scorekeep-frontend", "image":“xxx.dkr.ecr…frontend", "cpu": 256, "memoryReservation": 512, "portMappings" : [ { "containerPort": 8080 } ], "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": "us-east-1", "awslogs-stream-prefix": "scorekeep/frontend" } } } { "name": "scorekeep-api", "image":“xxx.dkr.ecr…api", "cpu": 768, "memoryReservation": 512, "portMappings" : [ { "containerPort": 5000 } ], "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": "us-east-1", "awslogs-stream-prefix": "scorekeep/api” } }, "environment": […] #env var } Final scorekeep task definition Task Definition scorekeep-frontend Container Definition scorekeep-api Container Definition
  • 71. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Find the Fargate Scorekeep project on GitHub at github.com/awslabs/eb-java-scorekeep/tree/fargate
  • 72. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What did we learn about Fargate?
  • 73. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Fargate is a new launch type within Amazon ECS to run containers without having to manage EC2 instances • If you’re debating between EC2 v/s Fargate mode, start architecting with Fargate. It forces good design practice by keeping your application containers truly independent of the underlying host. • If you think you must have access to the underlying host, think again. • There are some good reasons : special instance type needs, EC2 dedicated instances, utilizing EC2 reserved instances • And tell us about your use case, we want to support it on Fargate! • Start using Fargate today! • Fargate works with most Docker container images • You can run existing task definitions on Fargate with only minor modifications.
  • 74. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS: can be totally managed, or can customize resource usage, networking, task placement etc. to fit your application needs. Shared responsibility with AWS (because managed service). ecs-agent is open source. Easy integration with other AWS services. Amazon EKS: managed, upstream Kubernetes. Can connect to clusters through kubectl and use existing tooling. Can opt in to managed version upgrades. Add resources to your cluster through EC2 (now), or with Fargate mode (2018). Fargate: underlying technology for containers on demand. Pass a task definition or Kubernetes Pod, set resource limits, and Fargate manages everything else. NO access to underlying host, no managing of resources. Great if you don’t want to handle scaling, orchestration, deployments, upgrades yourself. Not for those of you that are making changes to your infrastructure (i.e., bringing custom AMIs, or installing things through EC2 user-data) tl;dr
  • 75. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Did you say you like CLI?
  • 76. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CLIs (that I know of) for Fargate/ECS: aws-cli: Open source, includes most AWS services. • More info here: https://aws.amazon.com/cli/ • GitHub here: https://github.com/aws/aws-cli ecs-cli: also official, but just for ECS. Supports docker compose files. • More info here: https://github.com/aws/amazon-ecs-cli Some good unofficial options: Fargate CLI: https://github.com/jpignata/fargate Coldbrew CLI: https://github.com/coldbrewcloud/coldbrew-cli
  • 77. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What’s Next?
  • 78. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. We want to hear from all of you! More focus on supporting Tasks as compute primitive, more focus on removing undifferentiated heavy lifting. Our roadmap is driven by feedback:
  • 79. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How can I get started? • To get started with Fargate: https://aws.amazon.com/fargate/ • Blogs: https://aws.amazon.com/blogs/aws/aws-fargate/ • https://aws.amazon.com/blogs/aws/amazon-elastic-container-service-for-kubernetes/ • Liz Rice from Aquasec on Fargate: https://blog.aquasec.com/securing-struts-in-aws-fargate • Nathan Peck from AWS: https://medium.com/containers-on-aws/choosing-your-container-environment-on- aws-with-ecs-eks-and-fargate-cfbe416ab1a • Deepak Singh (containers GM at AWS): https://www.slideshare.net/AmazonWebServices/containers-on- aws-state-of-the-union-con201-reinvent-2017
  • 80. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The awesome-ecs project: https://github.com/nathanpeck/awesome- ecs
  • 81. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Workshops! From @brentcontained https://t.co/ba0usbZqHN
  • 82. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Need a little help? Community Slack channels: awsdevelopers.slack.com amazon-ecs.slack.com Or reach out to one of us directly: @abbyfuller or abbyfull@amazon.com @nathankpeck @brentcontained @paulmaddox @ric_harvey
  • 83. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Go build (and tell us about it)!
  • 84. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Submit session feedback 1. Tap the Schedule icon. 2. Select the session you attended. 3. Tap Session Evaluation to submit your feedback.
  • 85. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thanks! @realz N E W Y O R K