habitat & amazon's ecs

27
AWS - Sydney North Shore October 25, 2016

Upload: matt-ray

Post on 14-Jan-2017

208 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Habitat & Amazon's ECS

AWS - Sydney North ShoreOctober 25, 2016

Page 2: Habitat & Amazon's ECS
Page 3: Habitat & Amazon's ECS
Page 4: Habitat & Amazon's ECS

Brent’s Desk

database cluster

Page 5: Habitat & Amazon's ECS

Infrastructure First Development

Page 6: Habitat & Amazon's ECS

Cloud Native is code for “Rewrite the world”

Page 7: Habitat & Amazon's ECS

What if you could defer infrastructure

decisions until runtime?

Page 8: Habitat & Amazon's ECS

HabitatApplication automation that enables modern

application teams to build, deploy, and run any application in any environment - from traditional

data-centers to containerized microservices.

Page 9: Habitat & Amazon's ECS

Build Service

Plan Artifact DepotBuild

Service

A Build Service with a workflow to describe the software and behavior for Habitat applications

Explicit about dependenciesIncludes what is configurable about the application

Packages are developed and built in an isolated build environment (hab studio)

Built Artifacts are post-processed in one step to multiple formats including Docker Images

Source Code Repo

Habitat Technology

Page 10: Habitat & Amazon's ECS

Post-process packaging

Page 11: Habitat & Amazon's ECS

Automation travels with the app

Page 12: Habitat & Amazon's ECS

Choreography

Page 13: Habitat & Amazon's ECS

Topology aware

Page 14: Habitat & Amazon's ECS

SecurityCode Quality

Container HostingPeer DiscoveryConfig Changes

SupervisionMonitoring

Rolling DeploymentNetworking

Internal RegistryWorkload Placement

Production

The Container Learning CliffDevelopment

Page 15: Habitat & Amazon's ECS

Habitat Technology

Plan Artifact DepotBuild

Service

Supervisor Supervisor

Supervisor Supervisor

Ring

Bare Metal

Containers

AMI

VM

Depot

Build Service & Workflow

Package Format Artifact Distribution Server

Artifact Distribution Server

Intelligent Run-Time Supervisor w/REST API

Source Code Repo

Page 16: Habitat & Amazon's ECS

Applications run as distributed, fully automated, and capable autonomous actors

Immutable applications, but flexible and easy to manage because automation travels with the application

Bundles what your apps need to run and nothing else (new and legacy)

Embedded automation choreographs application cluster topology/behavior

A network with no reliance on external services and no single-point-of-failure

Provides continuous deployment without traditional Application Release Automation (ARA) tooling

Habitat’s approach

Page 17: Habitat & Amazon's ECS
Page 18: Habitat & Amazon's ECS

Infrastructure Automation Application Automation Compliance Automation

Workflow

VisibilityC

ompliance

Page 19: Habitat & Amazon's ECS

• Chef

• Docker, Docker Swarm

• Mesos, DC/OS

• Kubernetes, Tectonic & OpenShift

• Nomad

• Rancher

• GKE

• ECS

Habitat is complementary to

Page 20: Habitat & Amazon's ECS

$ aws ecr get-login

returns the command used by

$ docker login…

$ docker images

$ aws ecr create-repository –repository-name mattray/redis

AWS ECR setup

Page 21: Habitat & Amazon's ECS

$ docker tag mattray/redis:latest aws_account_id.dkr.ecr.ap-southeast-2.amazonaws.com/mattray/redis:latest

$ docker push aws_account_id.dkr.ecr.ap-southeast-2.amazonaws.com/mattray/redis:latest

$ docker pull aws_account_id.dkr.ecr.ap-southeast-2.amazonaws.com/mattray/redis:latest

Deleting…

$ docker rmi mattray/redis:latest

$ aws ecr batch-delete-image --repository-name mattray/redis --image-ids imageTag=latest

AWS ECR publishing

Page 22: Habitat & Amazon's ECS

$ curl -o ~/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest

$ chmod +x ~/bin/ecs-cli

$ ecs-cli configure --cluster habitat-demo

stands up the cluster

$ ecs-cli up --keypair mattray-apac --capability-iam --size 2 --instance-type t2.medium --security-group habitat-demo

provisions hosts for containers with SSH, 8080 and Habitat ports open

AWS ECS setup

Page 23: Habitat & Amazon's ECS

$ aws ecs list-clusters

$ ecs-cli down –force

take down the Cloudformation cluster

$ ecs-cli compose --file redis.yml service rm

remove the deployed service

$ ssh -i ~/.ssh/mattray-apac [email protected]

connect to the running ECS host

$ docker logs e1e7834c6ab2

AWS ECS cluster management

Page 24: Habitat & Amazon's ECS

AWS ECS deploying tasks$ ecs-cli compose --file redis.yml -p habdemo up

version: '2’services:

redis:image: aws_account_id.dkr.ecr.ap-southeast-2.amazonaws.com/mattray/redis:latestcpu_shares: 100mem_limit: 524288000environment:

HAB_REDIS: 'tcp-backlog=128'

Page 25: Habitat & Amazon's ECS

Try Habitat for yourself

• https://www.habitat.sh/try

• https://github.com/habitat-sh/

• Tutorials

• Getting started guide

• Extensive documentation

• Support for Chef customers

Page 26: Habitat & Amazon's ECS

Links from the Presentation

• Redis plan

– https://github.com/habitat-sh/core-plans

• National Parks demo

– https://github.com/billmeyer/national-parks-plan

– https://github.com/billmeyer/national-parks

Page 27: Habitat & Amazon's ECS

27