77
Nov 3rd, 2014 Orchestrating Docker with OpenStack

Orchestrating Docker with OpenStack

Embed Size (px)

DESCRIPTION

The Nova driver for Docker has been maturing rapidly since its mainline removal in Icehouse. During the Juno cycle, substantial improvements have been made to the driver, and greater parity has been reached with other  virtualization drivers. We will explore these improvements and what they mean to deployers. Eric will additionally showcase deployment scenarios for the deployment of OpenStack itself inside and underneath of Docker for powering traditional VM-based computing, storage, and other cloud services. Finally, users should expect a preview of the planned integration with the new OpenStack Containers Service effort to provide automation of advanced containers functionality and Docker-API semantics inside of an OpenStack cloud. Note that the included Heat templates are NOT usable. See the linked Heat resources for viable templates and examples.

Citation preview

Page 1: Orchestrating Docker with OpenStack

Nov 3rd, 2014Orchestrating Docker with OpenStack

Page 2: Orchestrating Docker with OpenStack
Page 3: Orchestrating Docker with OpenStack

ComputeMAGNUM

Containers as a Service

Page 4: Orchestrating Docker with OpenStack

Project

SOLUM“Convert code into a managed application running on

an OpenStack cloud at the push of a button.”

FROM CODE TO MANAGED APP

Page 5: Orchestrating Docker with OpenStack

Docker Docker

Key element of the Solum data plane

Page 6: Orchestrating Docker with OpenStack

Applying HeatOrchestration for Docker API

Page 7: Orchestrating Docker with OpenStack

DockerHeat Resource

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Page 8: Orchestrating Docker with OpenStack

Installing the plugin

git clone https://github.com/openstack/heat ln -sf $PWD/heat/heat/contrib/docker/plugin; \ /usr/lib/heat/docker"

echo “plugin_dirs=$PWD/heat/heat/contrib/docker/plugin” >> /etc/heat/heat.conf

Page 9: Orchestrating Docker with OpenStack

DockerHeat Resource

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Page 10: Orchestrating Docker with OpenStack

DockerHeat Resource

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

1. Heat provides a Docker resource2. Docker resource communicates

directly to Docker3. Templates may glue Nova and

Docker resources4. Can deploy containers on top of

VMs or bare-metal instances.

Page 11: Orchestrating Docker with OpenStack

Heat: Cirrosheat_template_version: 2013-05-23 description: Single compute instance running cirros in a Docker container. resources: my_instance: type: OS::Nova::Server properties: key_name: ewindisch_key image: ubuntu-precise flavor: m1.large user_data: #include https://get.docker.io my_docker_container: type: DockerInc::Docker::Container docker_endpoint: { get_attr: [my_instance, first_address] } image: cirros

Page 12: Orchestrating Docker with OpenStack

Applying Heat

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Page 13: Orchestrating Docker with OpenStack

$ cat template.ymlheat_template_version: 2013-05-23 description: Single compute instance running cirros in a Docker container. resources: my_instance: type: OS::Nova::Server properties: key_name: ewindisch_key image: ubuntu-precise flavor: m1.large user_data: #include https://get.docker.io my_docker_container: type: DockerInc::Docker::Container docker_endpoint: { get_attr: [my_instance, first_address] } image: cirros

$ heat stack-create -f template.yml docker

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Applying Heat

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Heat API

VM

Docker

NovaNova resource

Docker resource

Container1

Container2

Container3

HOT

Page 14: Orchestrating Docker with OpenStack

Heat: Dockenstackheat_template_version: 2013-05-23 description: Single compute instance running Tempest resources: my_instance: type: OS::Nova::Server properties: key_name: ewindisch_key image: ubuntu-precise flavor: m1.large user_data: #include https://get.docker.io my_docker_container: type: DockerInc::Docker::Container properties: docker_endpoint: { get_attr: [my_instance, first_address] } image: dockenstack privileged: true cmd: /opt/dockenstack/bin/tempest

Page 15: Orchestrating Docker with OpenStack

heat_template_version: 2013-05-23 description: Two containers, one host with shared volumes resources: my_instance: type: OS::Nova::Server properties: key_name: ewindisch_key image: ubuntu-precise flavor: m1.large user_data: #include https://get.docker.io ftp_container: type: DockerInc::Docker::Container properties: docker_endpoint: { get_attr: [my_instance, first_address] } image: mikz/vsftpd ports: [ “21:21” ] volumes: [ “/ftp” ] name: “FTP” apache_container: type: DockerInc::Docker::Container properties: docker_endpoint: { get_attr: [my_instance, first_address] } image: fedora/apache ports: [ “80:80” ] volumes-from: “FTP” cmd: “rm -rf /var/www; ln -s /ftp /var/www; /run-apache.sh”

Page 16: Orchestrating Docker with OpenStack

Resources: Heat

• http://blog.oddbit.com/2014/08/30/docker-plugin-for-openstack-he/

• http://techs.enovance.com/7104/multi-tenant-docker-with-openstack-heat

Page 17: Orchestrating Docker with OpenStack

MAGNUM Containers as a Service

a new service of the OpenStack Compute program

Page 18: Orchestrating Docker with OpenStack

The Containers TeamWorking Group of the Compute Program

Page 19: Orchestrating Docker with OpenStack

The Containers TeamWorking Group of the Compute Program

• Operating underneath Compute program• Outlined a proposal for Magnum (Nova Mid-cycle)• Magnum would directly orchestrate containers• Would leverage all benefits and features unique to

containers.• It would be the “nova of containers”• It could use Nova to spawn instances to hold

containers.• Those instances may be VMs, Baremetal, or

Containers.

Page 20: Orchestrating Docker with OpenStack

See Adrian Otto’s presentation:Containers for Multi-cloud Apps

Tomorrow: 17:20

Page 21: Orchestrating Docker with OpenStack

Docker plugin for Nova

Nova Integration

Page 22: Orchestrating Docker with OpenStack

Awesome PeopleIan Main (Red Hat) Chris Alfonso (Red Hat) Davanum ‘dims’ (IBM) ChangBo Guo Julien Vey (Numergy) Aaron Rosen (Nicera) Derek Higgins (Red Hat) Paul Czarkowski (Rackspace) Daniel Kuffner

Pedro R Marques (Juniper) Lars Kellogg-Stedman (Red_Hat) Sam Alba (Docker) & more…

Page 23: Orchestrating Docker with OpenStack

What?Enables control of Docker via OpenStack:

• Nova API • Horizon UI

Supports: • launch • terminate • reboot • serial console • snapshot • Glance • Neutron • Pause/unpause

https://wiki.openstack.org/wiki/HypervisorSupportMatrix

Page 24: Orchestrating Docker with OpenStack

Identity Crisis

Page 25: Orchestrating Docker with OpenStack

Nova doesn’t…Link container networks

Pass environment variables Specify working directories

Create docker-volumes Share docker-volumes between containers

Arbitrary commands Arbitrary command-arguments

Pass devices

Nova is a machine abstraction, not a process one.

Page 26: Orchestrating Docker with OpenStack

Docker doesn’t…

• Support mounting devices (unprivileged) • Live-migration is future-speak • Boot from block devices (natively - it’s possible…) • Support Glance natively • PCI pass-through

Page 27: Orchestrating Docker with OpenStack

Havana & IcehouseImage Management

(at-release)

Page 28: Orchestrating Docker with OpenStack

Havana & IcehouseImage Management

• docker-registry worked as a proxy

• Users had to upload through docker-registry.

• docker pulls images through the docker-registry proxy

(at-release)

Page 29: Orchestrating Docker with OpenStack

Havana & IcehouseImage Management

(at-release)

Page 30: Orchestrating Docker with OpenStack

• Glance was only used to provide visibility of Docker images for Nova.

Havana & IcehouseImage Management

(at-release)

Page 31: Orchestrating Docker with OpenStack

• Glance was only used to provide visibility of Docker images for Nova.

• Users could not upload through Glance directly

Havana & IcehouseImage Management

(at-release)

Page 32: Orchestrating Docker with OpenStack

• Glance was only used to provide visibility of Docker images for Nova.

• Users could not upload through Glance directly

• Making that work would require a special procedure for glance uploads.

Havana & IcehouseImage Management

(at-release)

Page 33: Orchestrating Docker with OpenStack

so… we took out the docker-registry instead.

Page 34: Orchestrating Docker with OpenStack

Just Enough Docker

Page 35: Orchestrating Docker with OpenStack

Just Enough Docker

Page 36: Orchestrating Docker with OpenStack

Just Enough Docker

• A subset of Nova features…

Page 37: Orchestrating Docker with OpenStack

Just Enough Docker

• A subset of Nova features…• A subset of Docker features…

Page 38: Orchestrating Docker with OpenStack

Just Enough Docker

• A subset of Nova features…• A subset of Docker features…• Enough for Nova to allow running

Docker-in-Docker.

Page 39: Orchestrating Docker with OpenStack

Just Enough Docker

• A subset of Nova features…• A subset of Docker features…• Enough for Nova to allow running

Docker-in-Docker.• DinD retains most performance

benefits of Docker.

Page 40: Orchestrating Docker with OpenStack

Just Enough Docker

• A subset of Nova features…• A subset of Docker features…• Enough for Nova to allow running

Docker-in-Docker.• DinD retains most performance

benefits of Docker.• DinD is Docker and everything

you love about Docker.

Page 41: Orchestrating Docker with OpenStack

DockerOpenStackNova

novadocker

Page 42: Orchestrating Docker with OpenStack

DockerOpenStackNova

novadockerDocker

Page 43: Orchestrating Docker with OpenStack

DockerOpenStackNova

novadockerDocker

OpenStack API

Docker API

Page 44: Orchestrating Docker with OpenStack

DockerOpenStackNova

novadockerDocker

OpenStack API

Docker API

Docker API

Page 45: Orchestrating Docker with OpenStack

Docker

Page 46: Orchestrating Docker with OpenStack

Docker

Kubernetes Heat

Mesos CloudFoundry

OpenShiftSolum

Magnum

Page 47: Orchestrating Docker with OpenStack

nova-apineutron

nova-compute

VM

VM

docker

docker

Hypervisor

container

container

Page 48: Orchestrating Docker with OpenStack

nova-apineutron

Page 49: Orchestrating Docker with OpenStack

nova-apineutron

Page 50: Orchestrating Docker with OpenStack

nova-apineutron

nova-compute

container

container

Docker

Page 51: Orchestrating Docker with OpenStack

nova-apineutron

nova-compute

container

container

Docker

nova-compute

VM

VM

docker

docker

Hypervisor

container

container

Page 52: Orchestrating Docker with OpenStack

nova-apineutron

Hybrid Nova configuration

nova-compute

container

container

Docker

nova-compute

VM

VM

docker

docker

Hypervisor

container

container

Page 53: Orchestrating Docker with OpenStack

nova-apineutron

nova-compute

container

container

Docker

nova-compute

VM

VM

docker

docker

Hypervisor

container

container

nova-compute

Machine docker

Ironic

container

container

Page 54: Orchestrating Docker with OpenStack

nova-apineutron

Hybrid Nova configuration + Ironic

nova-compute

container

container

Docker

nova-compute

VM

VM

docker

docker

Hypervisor

container

container

nova-compute

Machine docker

Ironic

container

container

Page 55: Orchestrating Docker with OpenStack

nova-api

nova-compute

container docker

Docker

container

container

Page 56: Orchestrating Docker with OpenStack

nova-api

nova-compute

container docker

Docker

container

container

Page 57: Orchestrating Docker with OpenStack

nova-api

nova-compute

container docker

Docker

container

container

KubernetesHeat

Mesos

CloudFoundry

Magnum

Page 58: Orchestrating Docker with OpenStack

Install the plugin

mkdir git-co; cd git-co"

git clone https://github.com/stackforge/nova-docker"

cd nova-driver"

python setup.py install

Page 59: Orchestrating Docker with OpenStack

Configure Nova

Set in nova.conf:"

compute_driver=novadocker.virt.docker.DockerDriver"

Page 60: Orchestrating Docker with OpenStack

docker pull cirros"docker save cirros | glance image-create \ --is-public=True \ --container-format=docker \ --disk-format=raw \ --name cirros

Putting an image into your repository

Page 61: Orchestrating Docker with OpenStack

‘nova boot’

Page 62: Orchestrating Docker with OpenStack

Networking

Nova Network

Page 63: Orchestrating Docker with OpenStack

Please welcome:Ian Main

Page 64: Orchestrating Docker with OpenStack

Testing - Running & Passing

Page 65: Orchestrating Docker with OpenStack

- Get as many tests passing as possible.!- Now running 1726 tests, 0 failures.!- Turned off: volumes resizing & suspending rescue!! !migrations.

Testing - Running & Passing

Page 66: Orchestrating Docker with OpenStack

Working Upstream

Page 67: Orchestrating Docker with OpenStack

Working Upstream

• Added pause and unpause support for docker containers.• Well accepted into the Docker project.

• Dynamic device support needed for Cinder volumes.• First API that modifies running containers.• Docker community wants the user experience to be right.• It will land, just need to get it right

Page 68: Orchestrating Docker with OpenStack

Cinder VolumesUse cases:!• Direct access to block device – not common.!• Mounting file systems.!

- Possible security issues.!- Different from VMs.!- Privileged containers.!- FUSE filesystem support through user namespaces.!

• PoC of boot from volume.

Page 69: Orchestrating Docker with OpenStack

KILONova-Docker

Page 70: Orchestrating Docker with OpenStack

KILO

Page 71: Orchestrating Docker with OpenStack

- Cinder support

KILO

Page 72: Orchestrating Docker with OpenStack

- Cinder support

- Security groups (merged)

KILO

Page 73: Orchestrating Docker with OpenStack

- Cinder support

- Security groups (merged)

- docker-py (merged)

KILO

Page 74: Orchestrating Docker with OpenStack

- Cinder support

- Security groups (merged)

- docker-py (merged)

- privileged containers

KILO

Page 75: Orchestrating Docker with OpenStack

- Cinder support

- Security groups (merged)

- docker-py (merged)

- privileged containers

- more +2 contributors

KILO

Page 76: Orchestrating Docker with OpenStack

Fix our Bugs!use our code…

Page 77: Orchestrating Docker with OpenStack

Q & A

Eric Windisch <erw>@freenode @ewindisch

Ian Main <slower>@freenode