SlideShare a Scribd company logo
Getting-started-with-containers on AWS
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Marek Kuczynski
Solution Architect, AWS
@marekq
Getting started with Docker on
AWS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
The container sessions planned for today:
10:00-11:00 Getting started with Docker on AWS
11:00-11:30 Break
11:30-12:30 Deep dive on Amazon ECS & AWS Fargate
12:30-13:30 Lunch
13:30-14:30 Building a CI/CD Pipeline for deploying to containers
14:30-15:30 Amazon Elastic Container Service for Kubernetes (Amazon EKS)
15:30-15:45 Break
15:45-16:45 Building efficient and secure containers
@marekq
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What are containers and why are customers using them?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What are containers?
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://www.docker.com
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why not VM’s?
Server
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Bins/libs Bins/libs Bins/libs
App A App A App B
Server
Host OS
Docker Engine
Bins/libs Bins/libs
App
A
App
A
App
B
App
B
App
B
App
B
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Image
Read-only template
Used to launch container
Union file systems to combine
different layers into a single image
Docker images built from base
image, instructions to add layers on top
Instructions stored in Dockerfile
bootfs
kernel
Base image
Image
Image
W
ritable
Container
add
N
G
IN
X
add
nodejs
U
buntu
References
parent
image
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
An example Docker file
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y apache2
ADD src /var/www/
EXPOSE 80
CMD ["/usr/sbin/apache2", "-D", ”FOREGROUND"]
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why are containers so popular?
• Portable
• Lightweight
• Standardized
• Easy to deploy
• Containers and microservices go hand in hand
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The speed of innovation is based on the speed of
deployment
DEVELOP
BUILD
TEST
Secure
RELEASE
DEPLOY
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
First customers ran docker on EC2
+
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Containers made it easy to build and scale
cloud-native applications
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customers needed an easier way to manage large clusters of
instances and containers
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ELASTIC CONTAINER SERVICE
Cluster Management as a hosted service
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We removed the pain points and heavy lifting
• Scheduling
• Placement
• Task management (health checks)
• Management control plane updates
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS
Highl y sca l a bl e, high
perf o rm a nce co nta iner
m a na gem ent sy stem
A managed platform
ECS
Cluster
management
Container
orchestration
Deep AWS
integration
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What we did with ECS in 2018
Route 53 Auto Naming
Service Discovery
Daemon Scheduling
CLI Supports Docker Compose V3
ECS Agent Signed for Security
Faster Launch Times
SSM Parameter Support
Configure shm-size and tmpfs
Docker Container Health Checks
Task metric & metadata endpoint
Docker17.09
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customers Using ECS at Scale
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Registry
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECR
Container Registry
• Fully Managed
• Secure
• Highly Available
• Simplified Workflow
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kubernetes support
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
57%of Kubernetes workloads
run on AWS today
— Cloud Native Computing Foundation
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“Make this easier for us!”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“Native AWS Integrations.”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
”An Open Source Kubernetes Experience.”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
E L A S T I C C O N TA I N E R S E RV I C E F O R K U B E R N E T E S
(EKS)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EKS is Kubernetes Certified
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EKS
P l a t f o r m f o r
e n t e r p r i s e s t o r u n
p r o d u c t i o n - g r a d e
K u b e r n e t e s - g r a d e
i n s t a l l a t i o n s
EKS
Managed
and
upstream
experience
Seamless,
native
integration
with AWS
services
Contributes
back to
open
source
community
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
mycluster.eks.amazonaws.com
EKS Workers
kubectl
Amazon EKS
AZ 1 AZ 2 AZ 3
Your AWS account
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1.9.11.9.2
Version
1.9
Version
1.10
Kubernetes Upgrades
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Still managing workers/nodes is hard!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“Make this easier for us!”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Fargate
No cluster or
infrastructure to
manage or scale
Everything is
handled at the
container level
Scale seamlessly
on demand
Underlying technology for container
management
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What does Fargate mean?
No worrying about scaling, service mesh, underlying
infrastructure, cluster resources, capacity, setup.
Just give it a task definition or pod (coming in 2018), set
some resource limits, and away you go.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
With Fargate: focus on your
workload (job, container,
function, task) first. Full
stop.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How does this work in practice?
Two launch types for ECS and EKS:
• EC2 (traditional, manage your cluster infrastructure)
• Fargate
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TASK CPU MEMORY CONFIGURATIONS
50 different CPU/Memory configurations to choose from
CPU Memory
256 (.25 vCPU) 512MB, 1GB, 2GB
512 (.5 vCPU) 1GB, 2GB, 3GB, 4GB
1024 (1 vCPU) 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
2048 (2 vCPU) Between 4GB and 16GB in 1GB increments
4096 (4 vCPU) Between 8GB and 30GB in 1GB increments
© 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.
This is changing compute!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Treat containers as a fundamental, compute
primitive.
TASKS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• IAM Roles for Tasks
• Task Auto Scaling
• Task Load Balancers
• Task Networking
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Focus!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS
Highl y sca l a bl e, high
perf o rm a nce co nta iner
m a na gem ent sy stem
A managed platform
ECS
Cluster
management
Container
orchestration
Deep AWS
integration
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EKS
Managed Kubernetes on AWS
Highly available Automated
version upgrades
Integration with
other AWS
services
Etcd
Master
Managed
Kubernetes
control plane
CloudTrail, CloudWatch,
ELB, NLB, VPC,
PrivateLink
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate
Launch quickly
Scale easily
No infrastructure Resource based pricing
Containers on
demand
Manage everything at
container level
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Container Services Landscape
Management
Deployment, scheduling, scaling, and
management of containerized applications
Hosting
Where the containers run
Image Registry
Container image repository
Amazon Elastic
Container Service
Amazon Elastic
Container Service
for Kubernetes
Amazon EC2
AWS
Fargate
Amazon Elastic
Container Registry
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Getting started
• To learn more about EKS: https://aws.amazon.com/eks/
• To get started with Fargate: https://aws.amazon.com/fargate/
• Blogs and releases: https://aws.amazon.com/blogs/aws/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.
Agenda
The container sessions planned for today:
10:00-11:00 Getting started with Docker on AWS
11:00-11:30 Break
11:30-12:30 Deep dive on Amazon ECS & AWS Fargate
12:30-13:30 Lunch
13:30-14:30 Building a CI/CD Pipeline for deploying to containers
14:30-15:30 Amazon Elastic Container Service for Kubernetes (Amazon EKS)
15:30-15:45 Break
15:45-16:45 Building efficient and secure containers
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
Marek Kuczynski
@marekq

More Related Content

Getting-started-with-containers on AWS

  • 2. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Marek Kuczynski Solution Architect, AWS @marekq Getting started with Docker on AWS
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda The container sessions planned for today: 10:00-11:00 Getting started with Docker on AWS 11:00-11:30 Break 11:30-12:30 Deep dive on Amazon ECS & AWS Fargate 12:30-13:30 Lunch 13:30-14:30 Building a CI/CD Pipeline for deploying to containers 14:30-15:30 Amazon Elastic Container Service for Kubernetes (Amazon EKS) 15:30-15:45 Break 15:45-16:45 Building efficient and secure containers @marekq
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are containers and why are customers using them?
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are containers? 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://www.docker.com
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why not VM’s? Server Host OS Hypervisor Guest OS Guest OS Guest OS Bins/libs Bins/libs Bins/libs App A App A App B Server Host OS Docker Engine Bins/libs Bins/libs App A App A App B App B App B App B
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Docker Image Read-only template Used to launch container Union file systems to combine different layers into a single image Docker images built from base image, instructions to add layers on top Instructions stored in Dockerfile bootfs kernel Base image Image Image W ritable Container add N G IN X add nodejs U buntu References parent image
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. An example Docker file FROM ubuntu:latest RUN apt-get update RUN apt-get install -y apache2 ADD src /var/www/ EXPOSE 80 CMD ["/usr/sbin/apache2", "-D", ”FOREGROUND"]
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why are containers so popular? • Portable • Lightweight • Standardized • Easy to deploy • Containers and microservices go hand in hand
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The speed of innovation is based on the speed of deployment DEVELOP BUILD TEST Secure RELEASE DEPLOY
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. First customers ran docker on EC2 +
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Containers made it easy to build and scale cloud-native applications
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Customers needed an easier way to manage large clusters of instances and containers
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ELASTIC CONTAINER SERVICE Cluster Management as a hosted service
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. We removed the pain points and heavy lifting • Scheduling • Placement • Task management (health checks) • Management control plane updates
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ECS Highl y sca l a bl e, high perf o rm a nce co nta iner m a na gem ent sy stem A managed platform ECS Cluster management Container orchestration Deep AWS integration
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What we did with ECS in 2018 Route 53 Auto Naming Service Discovery Daemon Scheduling CLI Supports Docker Compose V3 ECS Agent Signed for Security Faster Launch Times SSM Parameter Support Configure shm-size and tmpfs Docker Container Health Checks Task metric & metadata endpoint Docker17.09
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Customers Using ECS at Scale
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Registry
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ECR Container Registry • Fully Managed • Secure • Highly Available • Simplified Workflow
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Kubernetes support
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 57%of Kubernetes workloads run on AWS today — Cloud Native Computing Foundation
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. “Make this easier for us!”
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. “Native AWS Integrations.”
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ”An Open Source Kubernetes Experience.”
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. E L A S T I C C O N TA I N E R S E RV I C E F O R K U B E R N E T E S (EKS)
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EKS is Kubernetes Certified
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EKS P l a t f o r m f o r e n t e r p r i s e s t o r u n p r o d u c t i o n - g r a d e K u b e r n e t e s - g r a d e i n s t a l l a t i o n s EKS Managed and upstream experience Seamless, native integration with AWS services Contributes back to open source community
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. mycluster.eks.amazonaws.com EKS Workers kubectl Amazon EKS AZ 1 AZ 2 AZ 3 Your AWS account
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 1.9.11.9.2 Version 1.9 Version 1.10 Kubernetes Upgrades
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Still managing workers/nodes is hard!
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. “Make this easier for us!”
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fargate
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Fargate No cluster or infrastructure to manage or scale Everything is handled at the container level Scale seamlessly on demand Underlying technology for container management
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What does Fargate mean? No worrying about scaling, service mesh, underlying infrastructure, cluster resources, capacity, setup. Just give it a task definition or pod (coming in 2018), set some resource limits, and away you go.
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. With Fargate: focus on your workload (job, container, function, task) first. Full stop.
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How does this work in practice? Two launch types for ECS and EKS: • EC2 (traditional, manage your cluster infrastructure) • Fargate
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TASK CPU MEMORY CONFIGURATIONS 50 different CPU/Memory configurations to choose from CPU Memory 256 (.25 vCPU) 512MB, 1GB, 2GB 512 (.5 vCPU) 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) Between 8GB and 30GB in 1GB increments
  • 39. © 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
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. This is changing compute!
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Treat containers as a fundamental, compute primitive. TASKS
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • IAM Roles for Tasks • Task Auto Scaling • Task Load Balancers • Task Networking
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Focus!
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Summary
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ECS Highl y sca l a bl e, high perf o rm a nce co nta iner m a na gem ent sy stem A managed platform ECS Cluster management Container orchestration Deep AWS integration
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EKS Managed Kubernetes on AWS Highly available Automated version upgrades Integration with other AWS services Etcd Master Managed Kubernetes control plane CloudTrail, CloudWatch, ELB, NLB, VPC, PrivateLink
  • 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fargate Launch quickly Scale easily No infrastructure Resource based pricing Containers on demand Manage everything at container level
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Container Services Landscape Management Deployment, scheduling, scaling, and management of containerized applications Hosting Where the containers run Image Registry Container image repository Amazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Amazon EC2 AWS Fargate Amazon Elastic Container Registry
  • 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Getting started • To learn more about EKS: https://aws.amazon.com/eks/ • To get started with Fargate: https://aws.amazon.com/fargate/ • Blogs and releases: https://aws.amazon.com/blogs/aws/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
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda The container sessions planned for today: 10:00-11:00 Getting started with Docker on AWS 11:00-11:30 Break 11:30-12:30 Deep dive on Amazon ECS & AWS Fargate 12:30-13:30 Lunch 13:30-14:30 Building a CI/CD Pipeline for deploying to containers 14:30-15:30 Amazon Elastic Container Service for Kubernetes (Amazon EKS) 15:30-15:45 Break 15:45-16:45 Building efficient and secure containers
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! Marek Kuczynski @marekq