docker online meetup: infrakit update and q&a

41
InfraKit Bill Farner David Chung

Upload: docker-inc

Post on 06-Jan-2017

5.192 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Docker Online Meetup: Infrakit update and Q&A

InfraKit

Bill Farner

David Chung

Page 2: Docker Online Meetup: Infrakit update and Q&A

mission

make Docker cluster infrastructure as simple and portable as Docker applications

Page 3: Docker Online Meetup: Infrakit update and Q&A

avoid silos

ACS setup routine

ACS runtime system

Docker for ACS UX

AWS setup routine

AWS runtime system

Docker for AWS UX

Page 4: Docker Online Meetup: Infrakit update and Q&A

common parts

setup routine

runtime system

Docker UX

AWSadapter

ACSadapter

Page 5: Docker Online Meetup: Infrakit update and Q&A

...most of this isn’t Docker-specific

Page 6: Docker Online Meetup: Infrakit update and Q&A

mission, revised

make Docker cluster infrastructure as simple and portable as Docker applications

Page 7: Docker Online Meetup: Infrakit update and Q&A

tl;dr InfraKit is...

a toolkit for infrastructure orchestration

Page 8: Docker Online Meetup: Infrakit update and Q&A

tl;dr InfraKit is...

a toolkit for infrastructure orchestration

‘scaling groups’ for any environment

Page 9: Docker Online Meetup: Infrakit update and Q&A

tl;dr InfraKit is...

a toolkit for infrastructure orchestration

‘scaling groups’ for any environment

young

Page 10: Docker Online Meetup: Infrakit update and Q&A

what InfraKit is not

coupled to Docker

Page 11: Docker Online Meetup: Infrakit update and Q&A

what InfraKit is not

coupled to Docker

a configuration management system (e.g. Terraform)

Page 12: Docker Online Meetup: Infrakit update and Q&A

what InfraKit is not

coupled to Docker

a configuration management system (e.g. Terraform)

a Swarm / Kubernetes alternative

Page 13: Docker Online Meetup: Infrakit update and Q&A

why InfraKit is special

declarative state

Page 14: Docker Online Meetup: Infrakit update and Q&A

why InfraKit is special

declarative state

continuous monitoring and reconciliation

Page 15: Docker Online Meetup: Infrakit update and Q&A

why InfraKit is special

declarative state

continuous monitoring and reconciliation

bias towards immutable infrastructure

Page 16: Docker Online Meetup: Infrakit update and Q&A

toolkit

primitives for managing groups of resources

a collection of components as plugins

abstractions, patterns, and APIs

Page 17: Docker Online Meetup: Infrakit update and Q&A

plugin types

instance: a resource (e.g. EC2 instance)

group: a collection of 'like' resources (e.g. ASG)

flavor: modification to an Instance (e.g. swarm join)

Page 18: Docker Online Meetup: Infrakit update and Q&A

plugin responsibilities

groupwatch, unwatch, destroy, update

flavorprepare, health, drain

instanceprovision, destroy

Page 19: Docker Online Meetup: Infrakit update and Q&A

defining useful and flexible abstractions

start with high-level nouns and verbs

avoid rigid schemas causing lowest common denominators

Page 20: Docker Online Meetup: Infrakit update and Q&A

abstract schemas

{

“Plugin”: “”,

“Properties”: {..}

}

$ grep -RI json.RawMessage . --exclude-dir vendor/ | wc -l

132

Page 21: Docker Online Meetup: Infrakit update and Q&A

...until the problem domain

type CreateInstanceRequest struct {RunInstancesInput ec2.RunInstancesInput*

}

request := CreateInstanceRequest{}err := json.Unmarshal(*spec.Properties, &request)

* github.com/aws/aws-sdk-go/tree/master/service/ec2

Page 22: Docker Online Meetup: Infrakit update and Q&A

{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}

Page 23: Docker Online Meetup: Infrakit update and Q&A

{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}

Page 24: Docker Online Meetup: Infrakit update and Q&A

{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}

Page 25: Docker Online Meetup: Infrakit update and Q&A

{ "ID": "nginx", "Properties": { "Allocation": { "Size": 3 }, "Instance" : { "Plugin": "instance-vagrant", "Properties": { "Box": "ubuntu-docker" } }, "Flavor" : { "Plugin": "flavor-vanilla", "Properties": { "Init": "docker run -d -p 80:80 nginx-alpine" } } }}

Page 26: Docker Online Meetup: Infrakit update and Q&A

Usage: infrakit group [command]

Available Commands: describe-update describe the steps to perform an update destroy destroy a group inspect inspect a group ls list groups stop-update stop updating a group unwatch unwatch a group update update a group watch watch a group

Page 27: Docker Online Meetup: Infrakit update and Q&A

let’s make a Docker cluster!

Page 28: Docker Online Meetup: Infrakit update and Q&A

the goal

2 self-healing groups

auto-attached EBS volumes

high availability

cluster VPCmanager security group

manager

docker

infrakit

EBS

manager

docker

infrakit

EBS

manager

docker

infrakit

EBSworker security group

worker

docker

worker

docker

worker

docker

Page 29: Docker Online Meetup: Infrakit update and Q&A

plugins used

group

flavor-combo instance-aws

flavor-vanilla flavor-swarm

Page 30: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

start watching

flavor-combo

flavor-vanilla flavor-swarm

Page 31: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

list instancesflavor-combo

flavor-vanilla flavor-swarm

Page 32: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-awsprepare instance flavor-combo

flavor-vanilla flavor-swarm

Page 33: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

prepare instance

flavor-combo

flavor-vanilla flavor-swarm

Page 34: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

prepare instance

flavor-combo

flavor-vanilla flavor-swarm

Page 35: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

fetch jointoken

docker

flavor-combo

flavor-vanilla flavor-swarm

Page 36: Docker Online Meetup: Infrakit update and Q&A

behind the scenes

group

instance-aws

create instance

flavor-combo

flavor-vanilla flavor-swarm

Page 37: Docker Online Meetup: Infrakit update and Q&A

if InfraKit creates resources...

what creates InfraKit?

Page 38: Docker Online Meetup: Infrakit update and Q&A

cluster VPCmanager security group

manager

docker

infrakit

EBS

manager

docker

infrakit

EBS

manager

docker

infrakit

EBSworker security group

worker

docker

worker

docker

worker

docker

Page 39: Docker Online Meetup: Infrakit update and Q&A

bootstrap

AWS resources- IAM role- network- EBS volumes

seed instance- docker swarm init- InfraKit

- configs- plugins- group watch

github.com/docker/infrakit.aws/tree/master/experimental/bootstrapcluster VPC

manager security group

EBS

manager

docker

infrakit

EBS

EBSworker security group

Page 40: Docker Online Meetup: Infrakit update and Q&A

demo

Page 41: Docker Online Meetup: Infrakit update and Q&A

github.com/docker/infrakit