docker online meetup: infrakit update and q&a
TRANSCRIPT
InfraKit
Bill Farner
David Chung
mission
make Docker cluster infrastructure as simple and portable as Docker applications
avoid silos
ACS setup routine
ACS runtime system
Docker for ACS UX
AWS setup routine
AWS runtime system
Docker for AWS UX
common parts
setup routine
runtime system
Docker UX
AWSadapter
ACSadapter
...most of this isn’t Docker-specific
mission, revised
make Docker cluster infrastructure as simple and portable as Docker applications
tl;dr InfraKit is...
a toolkit for infrastructure orchestration
tl;dr InfraKit is...
a toolkit for infrastructure orchestration
‘scaling groups’ for any environment
tl;dr InfraKit is...
a toolkit for infrastructure orchestration
‘scaling groups’ for any environment
young
what InfraKit is not
coupled to Docker
what InfraKit is not
coupled to Docker
a configuration management system (e.g. Terraform)
what InfraKit is not
coupled to Docker
a configuration management system (e.g. Terraform)
a Swarm / Kubernetes alternative
why InfraKit is special
declarative state
why InfraKit is special
declarative state
continuous monitoring and reconciliation
why InfraKit is special
declarative state
continuous monitoring and reconciliation
bias towards immutable infrastructure
toolkit
primitives for managing groups of resources
a collection of components as plugins
abstractions, patterns, and APIs
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)
plugin responsibilities
groupwatch, unwatch, destroy, update
flavorprepare, health, drain
instanceprovision, destroy
defining useful and flexible abstractions
start with high-level nouns and verbs
avoid rigid schemas causing lowest common denominators
abstract schemas
{
“Plugin”: “”,
“Properties”: {..}
}
$ grep -RI json.RawMessage . --exclude-dir vendor/ | wc -l
132
...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
{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}
{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}
{ "ID": "group-name", "Properties": { "Allocation": {..}, "Instance": { "Plugin": "instance-plugin-name", "Properties": {..} }, "Flavor": { "Plugin": "flavor-plugin-name", "Properties": {..} } }}
{ "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" } } }}
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
let’s make a Docker cluster!
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
plugins used
group
flavor-combo instance-aws
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
start watching
flavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
list instancesflavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-awsprepare instance flavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
prepare instance
flavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
prepare instance
flavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
fetch jointoken
docker
flavor-combo
flavor-vanilla flavor-swarm
behind the scenes
group
instance-aws
create instance
flavor-combo
flavor-vanilla flavor-swarm
if InfraKit creates resources...
what creates InfraKit?
cluster VPCmanager security group
manager
docker
infrakit
EBS
manager
docker
infrakit
EBS
manager
docker
infrakit
EBSworker security group
worker
docker
worker
docker
worker
docker
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
demo
github.com/docker/infrakit