Deliver Docker Containers Continuously on AWS. Philipp

Similar documents
Container Orchestration on Amazon Web Services. Arun

S U M M I T B e r l i n

AWS London Loft: CloudFormation Workshop

Training on Amazon AWS Cloud Computing. Course Content

LINUX, WINDOWS(MCSE),

Lean & Mean on AWS: Cost-Effective Architectures. Constantin Gonzalez, Solutions Architect, AWS

Introduction to Amazon EC2 Container Service (Amazon ECS) Hands On Lab

Deep Dive on Microservices and ECS

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

Wrapp. Powered by AWS EC2 Container Service. Jude D Souza Solutions Wrapp Phone:

/ Cloud Computing. Recitation 5 September 26 th, 2017

Enroll Now to Take online Course Contact: Demo video By Chandra sir

/ Cloud Computing. Recitation 5 February 14th, 2017

Getting Started With Amazon EC2 Container Service

Amazon Web Services Training. Training Topics:

How to Modify AWS CloudFormation Templates to Retrieve the PAR File from a Control Center

Containers and the Evolution of Computing

Driving DevOps Transformation in Enterprises

Amazon Web Services (AWS) Training Course Content

Automate All The Things. Software Defined Infrastructure with AWS CloudFormation, Docker and Jenkins

Follow me!

Building a Microservices Platform, Patterns and Best Practices

NGF0502 AWS Student Slides

Swift Web Applications on the AWS Cloud

Amazon Web Services (AWS) Solutions Architect Intermediate Level Course Content

Serverless Predictions at Scale

Designing MQ deployments for the cloud generation

Deploying an Active Directory Forest

We are ready to serve Latest IT Trends, Are you ready to learn? New Batches Info

Cloud & container monitoring , Lars Michelsen Check_MK Conference #4

PrepAwayExam. High-efficient Exam Materials are the best high pass-rate Exam Dumps

DevOps Course Content

Zero to Microservices in 5 minutes using Docker Containers. Mathew Lodge Weaveworks

Scaling Jenkins with Docker and Kubernetes Carlos

Cloud providers, tools and best practices in running Magento on Kubernetes. Adrian Balcan MindMagnet Software

DevOps Foundations : Infrastructure as Code

FROM MONOLITH TO DOCKER DISTRIBUTED APPLICATIONS

The Long Road from Capistrano to Kubernetes

Package your Java Application using Docker and Kubernetes. Arun

Deployments got you up all night?

São Paulo. August,

Kuber-what?! Learn about Kubernetes

Ahead in the Cloud. Matt Wood TECHNOLOGY EVANGELIST

Alan Williams Principal Engineer alanwill on Twitter & GitHub

DEVOPS COURSE CONTENT

cfn-pyplates Documentation

Automating Elasticity. March 2018

Introduction to Cloud Computing

Cloud Computing /AWS Course Content

PracticeDump. Free Practice Dumps - Unlimited Free Access of practice exam

Forseti Documentation

CPM. Quick Start Guide V2.4.0

At Course Completion Prepares you as per certification requirements for AWS Developer Associate.

DevOps Tooling from AWS

CLOUD AND AWS TECHNICAL ESSENTIALS PLUS

Heat: OpenStack Orchestrator

Deploy an external load balancer with

MarkLogic Server. MarkLogic Server on Amazon EC2 Guide. MarkLogic 9 May, Copyright 2018 MarkLogic Corporation. All rights reserved.

/ Cloud Computing. Recitation 5 September 27 th, 2016

Web Cloud Solution. User Guide. Issue 01. Date

Documentation. This PDF was generated for your convenience. For the latest documentation, always see

AWS Administration. Suggested Pre-requisites Basic IT Knowledge

TIBCO BusinessWorks Container Edition and Plug-ins for AWS Marketplace User's Guide

19 Best Practices. for Creating Amazon Cloud Formation Templates

What s New in Red Hat OpenShift Container Platform 3.4. Torben Jäger Red Hat Solution Architect

Cluster of Web-Servers with AWS

Getting Started with AWS Security

Kubernetes: Twelve KeyFeatures

Moving to the Cloud: Making It Happen With MarkLogic

SAP Hybris Commerce Leveraging the Public Cloud

EC2 and VPC Deployment Guide

Declarative Modeling for Cloud Deployments

Amazon Web Services. Block 402, 4 th Floor, Saptagiri Towers, Above Pantaloons, Begumpet Main Road, Hyderabad Telangana India

Ingress Kubernetes Tutorial

Securing Microservices Containerized Security in AWS

AWS Solution Architect Associate

Amazon Linux: Operating System of the Cloud

AWS Service Catalog. User Guide

Amazon Web Services Hands-On Auto Scaling

AWS Integration Guide

Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

About Intellipaat. About the Course. Why Take This Course?

Microservices on AWS. Matthias Jung, Solutions Architect AWS

Using DC/OS for Continuous Delivery

Remediate the Flag Practical AppSec Training Platform. Andrea Scaduto

AWS Solution Architecture Patterns

Designing Fault-Tolerant Applications

POSTGRESQL ON AWS: TIPS & TRICKS (AND HORROR STORIES) ALEXANDER KUKUSHKIN

Important DevOps Technologies (3+2+3days) for Deployment

AWS Reference Architecture - CloudGen Firewall Auto Scaling Cluster

Cloud Computing. Amazon Web Services (AWS)

AWS Solution Architect (AWS SA)

Deploying Containerized Applications in Amazon Elastic Container Service

POSTGRESQL ON AWS: TIPS & TRICKS (AND HORROR STORIES) ALEXANDER KUKUSHKIN. PostgresConf US

Kubernetes Integration Guide

Introduction to cloud computing

AWS Solutions Architect Exam Tips

Kubernetes: Integration vs Native Solution

Overview. Creating a Puppet Master

Transcription:

Deliver Docker Containers Continuously on AWS Philipp Garbe @pgarbe

Azure Container Services So many choices... Google Container Engine Cloud Foundry s Diego Amazon ECS Kubernetes Mesosphere Marathon Docker Swarm CoreOS Fleet https://www.linux.com/news/8-open-source-container-orchestration-tools-know

About Me Philipp Garbe Lead Developer @Scout24 Docker Captain Living in Bavaria Working in the Cloud

Hello ECS

Our first ECS cluster

ECS Cluster: Deployment Options AWS Console AWS CLI ECS CLI CloudFormation Easy to start Yes No Yes No Automation No Yes Yes Yes Infrastructure as Code No No No Yes Auto Scaling Yes Yes No Yes

AWSTemplateFormatVersion: '2010-09-09' Parameters: KeyName: Type: AWS::EC2::KeyPair::KeyName Description: EC2 KeyPair to enable SSH access.... Resources: ECSCluster: Type: AWS::ECS::Cluster ECSAutoScalingGroup: Type: AWS::AutoScaling::AutoScalingGroup Properties: VPCZoneIdentifier:!Ref ServiceSubnets LaunchConfigurationName:!Ref LaunchConfig MinSize:!Ref ClusterMinSize MaxSize:!Ref ClusterMaxSize LaunchConfig: Type: AWS::AutoScaling::LaunchConfiguration Metadata: AWS::CloudFormation::Init: config: commands: 01_add_instance_to_cluster: command:!sub #!/bin/bash echo ECS_CLUSTER=${ECSCluster} >> /etc/ecs/ecs.config Properties: ImageId:!FindInMap: [AWSRegionToAMI, Ref: AWS::Region, AMIID] InstanceType:!Ref InstanceType IamInstanceProfile:!Ref EC2InstanceProfile KeyName:!Ref KeyName... Outputs: ClusterName: Value:!Ref ECSCluster Export: Name:!Sub "${AWS::StackName}-ClusterName"

The first deployment

Container Definition Image Port mapping Mount points Network options Docker options

Task Definition IAM Task Role Volumes Network Mode Task Placement Constraints

Service Description Loadbalancer AutoScaling Deployment Configuration Task Placement Strategy

ECS Service: Deployment Options AWS Console AWS CLI ECS CLI CloudFormation Easy to start Yes No Yes No Automation No Yes Yes Yes Configuration as Code No No Partially Yes Auto Scaling Yes Yes No Yes Load Balancer Yes Yes No Yes Task Placement Yes Yes No No *

AWSTemplateFormatVersion: '2010-09-09' Parameters: DesiredCount: Type: Number ClusterStack: Type: String Description: Name of the cluster stack... Resources: TaskDefinition: Type: AWS::ECS::TaskDefinition Properties: TaskRoleArn:!Ref TaskAuthRole ContainerDefinitions: - Name: nginx Image:!Sub nginx:${version} Cpu: '2048' PortMappings: - ContainerPort: 80 Memory: '1024' Essential: 'true' WebApp: Type: AWS::ECS::Service Properties: Cluster: "Fn::ImportValue":!Sub "${ClusterStack}-ClusterName" TaskDefinition:!Ref TaskDefinition DesiredCount:!Ref DesiredCount DeploymentConfiguration: MaximumPercent: 200 MinimumHealthyPercent: 100 Role:!Ref ServiceAuthRole LoadBalancers: - ContainerName: nginx ContainerPort: 80 TargetGroupArn:!Ref TargetGroup

Load Balancing

Application Load Balancer (ALB)

Static Port Mapping (ELB)

Dynamic Port Mapping (ALB)

Up & Down

AutoScaling: Conclusion Two different kinds of scaling (cluster and service) Cluster: Use cpu / memory reservation metrics Service: Use cpu / memory utilization metrics Scale down to save money, but avoid endless-loop Scaling takes awhile to take effect ASG is not aware of ECS

AutoScaling: Rule of Thumb Threshold = (1 - max(container Reservation) / Total Capacity of a single Container Instance) * 100 Example: Container instance capacity: 2048 MB Container reservation: 512 MB Threshold = (1-512 / 2048) * 100 Threshold = 75%

Node draining Finally supported by ECS Use Lifecycle Hooks https://aws.amazon.com/blogs/compute/how-to-automate-container-instance-draining-in-amazon-ecs/

Best practices for ECS Cluster ASG UpdatePolicy defines deployment strategy cfn-init: Ensure Docker and ECS-Agent is running Put build no in UserData to enforce new EC2 instances

Volumes

EBS vs EFS

Security

https://iam.cloudonaut.io IAM Security Roles ecsautoscalingrole Read CloudWatch Metrics Modify App AutoScaling ecscontainerinstancerole ECR: Get Images ECS: De/Register Container Instances ecsservicerole De/Register Instances with Load Balancer ecstaskrole Everything your task needs to do

How to protect yourself EC2 Disallow access to metadata service from tasks (containers) IAM iptables --insert FORWARD 1 --in-interface docker+ --destination 169.254.169.254/32 --jump DROP Give the instance role only the credentials it needs (according to aws docs)

Cross Account Proxy Re-route call to ECS-Agent ECS-Agent gets credentials based on configured TaskRole TaskRole needs only one permission: AssumeRole X-Acc-Proxy assumes role (Role ARN comes from Docker Label) X-Acc-Proxy returns credentials from assumed role

Summary

What did we miss? Networking Logging Monitoring CloudWatch Events EC2 System Manager parameter store

Where ECS shines Stable Environment Catched up with task placement engine Native support of IAM AutoScaling for hosts and services CloudFormation all the way

And where not... Does not support all the Docker features (e.g. HEALTHCHECK) Disconnect between Docker Compose and Task Definition Network philosophy is different (Still no SecurityGroups for Containers) Volumes still not natively supported (3rd party tools needed) It s not a managed container service

Philipp Garbe http://garbe.io @pgarbe https://github.com/pgarbe https://boards.greenhouse.io/scout24