migration to docker with ecs

28
Migration to Docker with ECS ECS in Data Services

Upload: anton-pohorilyi

Post on 13-Apr-2017

306 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Migration to Docker with ECS

Migration to Docker with ECS

ECS in Data Services

Page 2: Migration to Docker with ECS

Change Drivers● Per-Project ops code (CMS2, SB2, Oracle, Mumford, Catalog Services,

Banyan, CIS, CSI, CLS, External Syndication, PRSyndication, etc.)

● Local/Cloud deployments are different

● Low cost efficiency for non-prod environments

● Slow deployments

Page 3: Migration to Docker with ECS

Main Goals● Improve Development Process

● Improve Deployment Process

● Reduce Costs

● Transparent Migration

Page 4: Migration to Docker with ECS

Development Process Improvements● Airplane Mode

● Fast Iterations

● Pre-committed Tests

● Local ~= Cloud

Page 5: Migration to Docker with ECS

Deployment Process Improvements● Single Process for Multiple Projects

● Better EC2 Resources Utilization

● Blue/Green Deployment

● Rapid Deployment

Page 6: Migration to Docker with ECS

Cost Reduction Areas● Low CI/CERT efficient ratio

● CI is mostly for cloud-adopted tests

● Instance types not optimal (CPU, Memory, Storage)

Page 7: Migration to Docker with ECS

Exploration● Generalize current deployment (CloudFormation + Puppet + CLI) across all

projects (Common ops Git project + Project-specific ones)

● Custom AMIs (Packer)

● Flynn

● Docker Swarm

● EC2 Container Service (ECS)

Page 8: Migration to Docker with ECS

EC2 Container Service

Page 9: Migration to Docker with ECS

ECS Benefits● IAM Support

● Dynamic Resources Allocation

● Pay Only for EC2 Resources

● Scaling Based on CloudWatch

● Blue/Green Deployment

● ECR (EC2 Container Registry) Integration

● Deployment Configuration Percentage

Page 10: Migration to Docker with ECS

ECS Components● Cluster

● Container Instance

● Task Definition

● Scheduler

● Service

● Task

● Container

Page 11: Migration to Docker with ECS

ECS Limitations● Fixed ELB to Container Relationship (One Instance - One Service)

● Limited ELB Features

● Lack of ECS Support in CloudFormation

Page 12: Migration to Docker with ECS

Dynamic Services● Dynamic private IP

addresses

● Dynamic Ports

Page 13: Migration to Docker with ECS

Service Discovery● Etcd

● Consul

● Zookeeper

● Airbnb Synapse

● SkyDNS

● ...

Page 14: Migration to Docker with ECS

Service Registration● Registrator

● Netflix Prana

● Airbnb Nerve

● ...

Page 15: Migration to Docker with ECS

Dynamic Balancing● Consul-template

● Traefik

● Tutum

● etc

Page 16: Migration to Docker with ECS

Consul + Registrator + Consul-template(HAProxy)

Page 17: Migration to Docker with ECS
Page 18: Migration to Docker with ECS

Container Balancing Modes Port-to-Port Balancing

APP_PORT 9080

ENV SERVICE_${APP_PORT}_TAGS PTP

Name-based Balancing

APP_PORT 9080

ENV SERVICE_${APP_PORT}_TAGS ci-banyan, ci-banyan-int

Page 19: Migration to Docker with ECS

Zookeeper/Badger RegistrationProblem

● Docker private socket: 172.17.0.2:9081 cat not be reachable from outside

Solution

● Consul lookup for external socket. Socket of EC2 instance: 10.0.33.156:32457

● Application config change to allow override ZK/Badger socket

Page 20: Migration to Docker with ECS

ECS CloudFormation: Missing Features● Logging support not implemented

● Deployment Configuration not implemented

● Only TCP ports can be exposed

● Task Revision update not implemented

● Inactive tasks flood Web interface

Page 21: Migration to Docker with ECS

ECS Toolset● Thor - Ruby-based CLI Toolkit

● CloudFormation for ECS EC2 Resources

● Ruby AWS SDK v2 for ECS Resources

Page 22: Migration to Docker with ECS

Demo

Page 23: Migration to Docker with ECS

Dev Side

Page 24: Migration to Docker with ECS

Dev Process Changes● Use Docker

● Provide your jar and build an image

● Mount your code (for not-compiling frameworks)

● Test cloud setup locally instead of CI

● Push your image to ECR

Page 25: Migration to Docker with ECS

Demo

Page 26: Migration to Docker with ECS

To Do List ● Proceed with migration

● Related services in containers (EmoDB, Polloi, etc)

● CLI improvements

● Registrator for ZK and Badger

● Better scaling

Page 27: Migration to Docker with ECS

Questions?