SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Consuming Cinder from
Docker
John Griffith
SolidFire/NetApp
August 23, 2016
About me
• Contributing to OpenStack a while (longer than some, less than others)
• Have been pretty passionate about core Cinder and things like reference driver
• Worked at a little Storage Startup called SolidFire recently bought by NetApp
• Have an AWESOME job where I get to work on OSS and always try new things
• Can be opinionated and blunt at times… sorry about that
2
3
Maybe you showed up because you heard
rumors that I’d talk about Docker?
4
OpenStack Cinder -Block Storage as a Service
• Abstraction layer to provide a pool of Block Resources
• Use backend storage from different vendors, don’t have to care of
know what’s actually serving up the blocks
• Scale out… just keep plugging in back-ends
• Scheduler can figure out where to place volumes for you
5
It’s like having an infinite number of disks
That you can hot plug in and out of your Instances
Photo Credit: Roger Smith
6
Only really need a few things
• Create/Delete
• Attach/Detach
• Snapshot
7
Of course there’s more for those that want it
• Replication
• CG’s
• Backups
• Migration
• Imports/Exports
• Transfer ownership
• Extend
• ...
(This is me trying not to be opinionated and blunt… moving on)
8
I was told this would be a Docker talk!!
9
Yes, I’m going to talk about Docker
• Docker is the best geek bait EVER!!!
• “OpenStack in Containers”
• “Container Orchestration in OpenStack”
• “OpenStack on Kubernetes”
10
Unicorns for EVERYONE
• All sorts of interesting ideas and plans on
the horizon
• Let’s bypass some of the hype and just
talk about some cool stuff you can do
today
• Try to remember a little bit of the past
while we’re at it
11
History repeats itself in tech
• $NEW_THING is like pets vs cattle
• $NEW_THING needs better networking
• $NEW_THING needs persistent storage
• $NEW_THING is a different development paradigm
• $NEW_THING is about small ephemeral services
echo $NEW_THING
OpenStack
export NEW_THING=Containers
12
Just like we heard in OpenStack –Containers need
networking and storage options
• Volume Plugin capability for Docker introduced initially in 1.8
• Continues to mature
• List of Vendors racing to provide a plugin accelerating rapidly
• Nobody wants to be late to the party, especially those that were late to Cinder
13
Docker Volume Plugins –General things to know
• Docker provides a simple Volume API
• INCLUDES PROVISIONING!!!!!
• Driver runs as a daemon
• Most common right now are simple UNIX domain sockets
• Runs on same node as the Docker Engine
• json-rpc over http POST
• Works with Swarm, Engine and Compose
So I wrote a Cinder Plugin
• Written in Golang
• Focus on JUST Cinder
• Vendor neutral/independent
• Open Source
• Gladly welcome contributors and feedback
• Anticipating/Hoping for Cinder community support
14
15
Can’t I already do this?
Yep, you can
Cool stuff out there already
Adoption is the greatest compliment
16
Don’t get me wrong
Some of those existing plugins that wrap up Cinder
are pretty cool
Some offer additional benefits
Some might fit your use case better
Some of them you may have already invested in and
have relationships with the contributing vendors
Do your thing, that’s AWESOME
Don’t hate, we’re all in this together
17
Brace yourselves, it’s about to get terrifying…
Well… for a few people at least
18
These Plugins aren’t under an umbrella
• Docker Plugins are NOT in a Docker repo
• Cinder Docker Plugin isn’t in an OpenStack repo
19
Some OpenStack folks just had a stroke
For now: https://github.com/j-griffith/cinder-docker-driver
Licensed under the “unlicense”
Potential for inclusion under OpenStack some day? Or maybe Docker?
20
So how does this work
• It’s not “much” different than how we do things with OpenStack/Nova
• Create a volume
• Attach a volume
• It’s all the same stuff we’ve been doing for years, we just change the
consumer
• Cinder really doesn’t care what you’re doing on the other side
• By the way, we’re talking Docker, but it doesn’t have to be Docker either
21
I have to give a shout out to Docker on1.12
• Docker 1.12 was a HUGE step forward
• Swarm advancements are my favorite
• I can deploy a Swarm cluster wicked fast
• Swarm in OpenStack or Public Cloud is stupid easy
22
Recipe for a tasty Swarm Cluster with persistent data
Start with some Peanut Butter
• Basic OpenStack Cloud
• Compute Networking and Storage
Mix in a bit of Chocolate
• Docker 1.12
Top it off with some frosting
• Cinder Docker Driver
23
We’ll use docker-machine with the OpenStack driver –
Because we can, and it works pretty well
(Our OpenStack Cloud)
24
We have our ingredients, here’s the basic steps
1. docker-machine to create 3 Nova Instances and setup Docker
2. Create a Swarm Cluster
3. Install , configure and start the cinder-docker-driver
4. Deploy a Swarm service that creates and uses a Cinder Volume
25
Create our nodes –use env vars instead of args
We’ll use docker-machine and the built in OpenStack driver for this
There’s a LOT of arguments required to the cli, so let’s start by creating an env file rather
than typing everything in.
export OS_FLAVOR_ID=2export OS_DOMAIN_NAME=$OS_USER_DOMAIN_NAME
export OS_IMAGE_ID=d5c276bc-cb70-42c4-9291-96f40a03a74c
export OS_SSH_USER=ubuntu
export OS_KEYPAIR_NAME=jdg
export OS_PRIVATE_KEY_FILE=$HOME/.ssh/id_rsaexport OS_SSH_USER=ubuntu
export OS_TENANT_ID=$OS_PROJECT_ID
26
Create our nodes
This just does our ”nova boot ….” for us, creating the Instances based on env vars
It does a few additional things for us too though
• Install Docker
• Configure and Setup certs for Docker
• Verify Docker is up and running
• Create a node entry in the docker nodes db
➜ docker-machine create –d openstack swarm-1
➜ docker-machine create –d openstack swarm-2
➜ docker-machine create –d openstack swarm-3
27
We can view our nodes using docker-machine
➜ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER
ERRORS
swarm-1 - openstack Running tcp://172.16.140.157:2376 v1.12.0
swarm-2 - openstack Running tcp://172.16.140.159:2376 v1.12.0
swarm-3 - openstack Running tcp://172.16.140.161:2376 v1.12.0
28
Set a node up as a Swarm Manager
➜ eval $(docker-machine env swarm-1)
➜ SWARM-1-IP=$(docker-machine ip swarm-1)
➜ docker swarm init --advertise-addr $SWARM-1-IP –listen-addr $SWARM-1-IP:2377
Swarm initialized: current node (5oi3h06yci5mvsau6czcbbxqu) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join 
--token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o
-3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the
instructions.
29
Set our other two Instances as Workers
➜ eval $(docker-machine env swarm-2)
➜ docker swarm join --token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o-
3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377
This node joined a swarm as a worker.
➜ eval $(docker-machine env swarm-3)
➜ docker swarm join --token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o-
3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377
This node joined a swarm as a worker.
30
That’s it, you now have a Swarm Cluster!!!!
31
Now it’s time to install the Cinder Driver
on each Node
• Install the driver
• Copy over a config file
• Start the daemon
• Restart Docker
32
You can just use docker-machine from
your laptop…
➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "curl –sSL 
https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh 
| sh -" ; done
➜ for each in $(docker-machine ls -q); do; docker-machine scp cdd.config.json 
$each:~/config.json; done
➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "sudo 
cinder-docker-driver --config config.json > cdd.log 2>&1 &" ; done
➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "sudo 
Service docker restart" ; done
33
About that install….
Config file is just OpenStack Creds
Creating a Service file for the driver has made
it’s way up pretty far on the TODO list
{
"Endpoint": "http://172.16.140.243:5000/v2.0",
"Username": "jdg",
"Password": “ABC123",
"TenantID": "3dce5dd10b414ac1b942aba8ce8558e7“
}
34
Now you can do cool things
Let’s build the simple counter application
• Redis container with Cinder Volume
• Web front end to take user input
We’ll run this as a Swarm service, so we can do things
like scale it, drain-nodes and move the containers
uninterrupted.
All while persisting our Redis data
35
Create a Docker network first so the Swarm
nodes have a layer to communicate on…
➜ eval $(docker-machine env swarm-1)
➜ docker network create demo-net
Bd45fad9911005ce2ff8e311a2738681d179589d8d06989a136e8020bc5a8155
36
Launch our services, start with the Redis
service…
➜ eval $(docker-machine env swarm-1)
➜ docker service create --name redis --network demo-net –-mount 
type=volume,src=counter-demo,dst=/data,volume-driver=cinder -p 6379:6379 redis
This will:
• Pull the Redis image if it’s not available
• Get/Create the volume on the Cinder backend
• Attach the Volume to the Swarm node
• Partition, Format and Mount the Volume
• Link the volume to the Redis Containers /data directory
• Start the Redis Container
37
You can see the attached volume on the
Swarm Node….
ubuntu@swarm-3:~$ ls /dev/disk/by-path/
ip-10.10.9.1:3260-iscsi-iqn.2010-01.com.solidfire:ayyb.uuid-59e99b3b-c7d6-45c2-924c-
virtio-pci-0000:00:04.0
virtio-pci-0000:00:04.0-part1
Same as we do for Nova Compute nodes… nothing really different except we add the file system
38
Now, the web service/frontend…
➜ docker service create --name web --network demonet -p 80:80 
jgriffith/jgriffith webbase
This will:
• Connect to our Redis container (regardless of what Swarm node it’s on)
• Expose port 80 to all of the Swarm Nodes (access from any Swarm Node IP)
• Count input/clicks and store them in the Redis DB

Más contenido relacionado

La actualidad más candente

Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Erica Windisch
 
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Brice Argenson
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Cassandra and docker
Cassandra and dockerCassandra and docker
Cassandra and dockerBen Bromhead
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyGiovanni Toraldo
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementNicola Paolucci
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...Atlassian
 
Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1dotCloud
 
Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Trevor Roberts Jr.
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStackOrchestrating Docker with OpenStack
Orchestrating Docker with OpenStackErica Windisch
 
Scaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoScaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoVali-Marius Malinoiu
 
Dockercon Swarm Updated
Dockercon Swarm UpdatedDockercon Swarm Updated
Dockercon Swarm UpdatedDocker, Inc.
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chefbridgetkromhout
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarmHsi-Kai Wang
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Sadique Puthen
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2Liang Bo
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introductionEvan Lin
 

La actualidad más candente (20)

Docker swarm
Docker swarmDocker swarm
Docker swarm
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
 
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Cassandra and docker
Cassandra and dockerCassandra and docker
Cassandra and docker
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster management
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
 
Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1Running Docker with OpenStack | Docker workshop #1
Running Docker with OpenStack | Docker workshop #1
 
Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStackOrchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
 
Scaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoScaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and Presto
 
Dockercon Swarm Updated
Dockercon Swarm UpdatedDockercon Swarm Updated
Dockercon Swarm Updated
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarm
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introduction
 

Destacado

A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...Docker, Inc.
 
Discovering Docker Volume Plugins and Apps using VirtualBox
Discovering Docker Volume Plugins and Apps using VirtualBoxDiscovering Docker Volume Plugins and Apps using VirtualBox
Discovering Docker Volume Plugins and Apps using VirtualBoxClinton Kitson
 
Planning your OpenStack PoC
Planning your OpenStack PoCPlanning your OpenStack PoC
Planning your OpenStack PoCopenstackstl
 
Docker home ted
Docker home tedDocker home ted
Docker home tedLayne Peng
 
OpenStack Cinder Overview - Havana Release
OpenStack Cinder Overview - Havana ReleaseOpenStack Cinder Overview - Havana Release
OpenStack Cinder Overview - Havana ReleaseAvishay Traeger
 
快速上手 Windows Containers 容器技術 (Docker Taipei)
快速上手 Windows Containers 容器技術 (Docker Taipei)快速上手 Windows Containers 容器技術 (Docker Taipei)
快速上手 Windows Containers 容器技術 (Docker Taipei)Will Huang
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAmazon Web Services
 
提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?Chen Cheng-Wei
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲ChinaNetCloud
 
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...Docker, Inc.
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker, Inc.
 
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)Amazon Web Services
 
今だからこそ振り返ろう!OWASP Top 10
今だからこそ振り返ろう!OWASP Top 10今だからこそ振り返ろう!OWASP Top 10
今だからこそ振り返ろう!OWASP Top 10Daiki Ichinose
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeAcademy
 

Destacado (16)

A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
 
Docker volume
Docker volumeDocker volume
Docker volume
 
Discovering Docker Volume Plugins and Apps using VirtualBox
Discovering Docker Volume Plugins and Apps using VirtualBoxDiscovering Docker Volume Plugins and Apps using VirtualBox
Discovering Docker Volume Plugins and Apps using VirtualBox
 
Planning your OpenStack PoC
Planning your OpenStack PoCPlanning your OpenStack PoC
Planning your OpenStack PoC
 
Docker home ted
Docker home tedDocker home ted
Docker home ted
 
OpenStack Cinder Overview - Havana Release
OpenStack Cinder Overview - Havana ReleaseOpenStack Cinder Overview - Havana Release
OpenStack Cinder Overview - Havana Release
 
快速上手 Windows Containers 容器技術 (Docker Taipei)
快速上手 Windows Containers 容器技術 (Docker Taipei)快速上手 Windows Containers 容器技術 (Docker Taipei)
快速上手 Windows Containers 容器技術 (Docker Taipei)
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWS
 
Docker應用
Docker應用Docker應用
Docker應用
 
提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
 
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
 
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)
AWS re:Invent 2016: Getting Started with Docker on AWS (CMP209)
 
今だからこそ振り返ろう!OWASP Top 10
今だからこそ振り返ろう!OWASP Top 10今だからこそ振り返ろう!OWASP Top 10
今だからこそ振り返ろう!OWASP Top 10
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101
 

Similar a Consuming Cinder from Docker

Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCSOracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCSFrank Munz
 
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017Frank Munz
 
Orchestrating Docker - Making the Whale Dance
Orchestrating Docker - Making the Whale DanceOrchestrating Docker - Making the Whale Dance
Orchestrating Docker - Making the Whale DanceJames Turnbull
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerJames Turnbull
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at NuxeoNuxeo
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
Docker introduction
Docker introductionDocker introduction
Docker introductionJo Ee Liew
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Dockernklmish
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralovedamovsky
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkJérôme Petazzoni
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsRamit Surana
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 

Similar a Consuming Cinder from Docker (20)

Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCSOracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
 
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
 
Orchestrating Docker - Making the Whale Dance
Orchestrating Docker - Making the Whale DanceOrchestrating Docker - Making the Whale Dance
Orchestrating Docker - Making the Whale Dance
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
 
Docker 101
Docker 101Docker 101
Docker 101
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
What is octohost?
What is octohost?What is octohost?
What is octohost?
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Docker Started
Docker StartedDocker Started
Docker Started
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

Consuming Cinder from Docker

  • 1. Consuming Cinder from Docker John Griffith SolidFire/NetApp August 23, 2016
  • 2. About me • Contributing to OpenStack a while (longer than some, less than others) • Have been pretty passionate about core Cinder and things like reference driver • Worked at a little Storage Startup called SolidFire recently bought by NetApp • Have an AWESOME job where I get to work on OSS and always try new things • Can be opinionated and blunt at times… sorry about that 2
  • 3. 3 Maybe you showed up because you heard rumors that I’d talk about Docker?
  • 4. 4 OpenStack Cinder -Block Storage as a Service • Abstraction layer to provide a pool of Block Resources • Use backend storage from different vendors, don’t have to care of know what’s actually serving up the blocks • Scale out… just keep plugging in back-ends • Scheduler can figure out where to place volumes for you
  • 5. 5 It’s like having an infinite number of disks That you can hot plug in and out of your Instances Photo Credit: Roger Smith
  • 6. 6 Only really need a few things • Create/Delete • Attach/Detach • Snapshot
  • 7. 7 Of course there’s more for those that want it • Replication • CG’s • Backups • Migration • Imports/Exports • Transfer ownership • Extend • ... (This is me trying not to be opinionated and blunt… moving on)
  • 8. 8 I was told this would be a Docker talk!!
  • 9. 9 Yes, I’m going to talk about Docker • Docker is the best geek bait EVER!!! • “OpenStack in Containers” • “Container Orchestration in OpenStack” • “OpenStack on Kubernetes”
  • 10. 10 Unicorns for EVERYONE • All sorts of interesting ideas and plans on the horizon • Let’s bypass some of the hype and just talk about some cool stuff you can do today • Try to remember a little bit of the past while we’re at it
  • 11. 11 History repeats itself in tech • $NEW_THING is like pets vs cattle • $NEW_THING needs better networking • $NEW_THING needs persistent storage • $NEW_THING is a different development paradigm • $NEW_THING is about small ephemeral services echo $NEW_THING OpenStack export NEW_THING=Containers
  • 12. 12 Just like we heard in OpenStack –Containers need networking and storage options • Volume Plugin capability for Docker introduced initially in 1.8 • Continues to mature • List of Vendors racing to provide a plugin accelerating rapidly • Nobody wants to be late to the party, especially those that were late to Cinder
  • 13. 13 Docker Volume Plugins –General things to know • Docker provides a simple Volume API • INCLUDES PROVISIONING!!!!! • Driver runs as a daemon • Most common right now are simple UNIX domain sockets • Runs on same node as the Docker Engine • json-rpc over http POST • Works with Swarm, Engine and Compose
  • 14. So I wrote a Cinder Plugin • Written in Golang • Focus on JUST Cinder • Vendor neutral/independent • Open Source • Gladly welcome contributors and feedback • Anticipating/Hoping for Cinder community support 14
  • 15. 15 Can’t I already do this? Yep, you can Cool stuff out there already Adoption is the greatest compliment
  • 16. 16 Don’t get me wrong Some of those existing plugins that wrap up Cinder are pretty cool Some offer additional benefits Some might fit your use case better Some of them you may have already invested in and have relationships with the contributing vendors Do your thing, that’s AWESOME Don’t hate, we’re all in this together
  • 17. 17 Brace yourselves, it’s about to get terrifying… Well… for a few people at least
  • 18. 18 These Plugins aren’t under an umbrella • Docker Plugins are NOT in a Docker repo • Cinder Docker Plugin isn’t in an OpenStack repo
  • 19. 19 Some OpenStack folks just had a stroke For now: https://github.com/j-griffith/cinder-docker-driver Licensed under the “unlicense” Potential for inclusion under OpenStack some day? Or maybe Docker?
  • 20. 20 So how does this work • It’s not “much” different than how we do things with OpenStack/Nova • Create a volume • Attach a volume • It’s all the same stuff we’ve been doing for years, we just change the consumer • Cinder really doesn’t care what you’re doing on the other side • By the way, we’re talking Docker, but it doesn’t have to be Docker either
  • 21. 21 I have to give a shout out to Docker on1.12 • Docker 1.12 was a HUGE step forward • Swarm advancements are my favorite • I can deploy a Swarm cluster wicked fast • Swarm in OpenStack or Public Cloud is stupid easy
  • 22. 22 Recipe for a tasty Swarm Cluster with persistent data Start with some Peanut Butter • Basic OpenStack Cloud • Compute Networking and Storage Mix in a bit of Chocolate • Docker 1.12 Top it off with some frosting • Cinder Docker Driver
  • 23. 23 We’ll use docker-machine with the OpenStack driver – Because we can, and it works pretty well (Our OpenStack Cloud)
  • 24. 24 We have our ingredients, here’s the basic steps 1. docker-machine to create 3 Nova Instances and setup Docker 2. Create a Swarm Cluster 3. Install , configure and start the cinder-docker-driver 4. Deploy a Swarm service that creates and uses a Cinder Volume
  • 25. 25 Create our nodes –use env vars instead of args We’ll use docker-machine and the built in OpenStack driver for this There’s a LOT of arguments required to the cli, so let’s start by creating an env file rather than typing everything in. export OS_FLAVOR_ID=2export OS_DOMAIN_NAME=$OS_USER_DOMAIN_NAME export OS_IMAGE_ID=d5c276bc-cb70-42c4-9291-96f40a03a74c export OS_SSH_USER=ubuntu export OS_KEYPAIR_NAME=jdg export OS_PRIVATE_KEY_FILE=$HOME/.ssh/id_rsaexport OS_SSH_USER=ubuntu export OS_TENANT_ID=$OS_PROJECT_ID
  • 26. 26 Create our nodes This just does our ”nova boot ….” for us, creating the Instances based on env vars It does a few additional things for us too though • Install Docker • Configure and Setup certs for Docker • Verify Docker is up and running • Create a node entry in the docker nodes db ➜ docker-machine create –d openstack swarm-1 ➜ docker-machine create –d openstack swarm-2 ➜ docker-machine create –d openstack swarm-3
  • 27. 27 We can view our nodes using docker-machine ➜ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS swarm-1 - openstack Running tcp://172.16.140.157:2376 v1.12.0 swarm-2 - openstack Running tcp://172.16.140.159:2376 v1.12.0 swarm-3 - openstack Running tcp://172.16.140.161:2376 v1.12.0
  • 28. 28 Set a node up as a Swarm Manager ➜ eval $(docker-machine env swarm-1) ➜ SWARM-1-IP=$(docker-machine ip swarm-1) ➜ docker swarm init --advertise-addr $SWARM-1-IP –listen-addr $SWARM-1-IP:2377 Swarm initialized: current node (5oi3h06yci5mvsau6czcbbxqu) is now a manager. To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o -3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
  • 29. 29 Set our other two Instances as Workers ➜ eval $(docker-machine env swarm-2) ➜ docker swarm join --token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o- 3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377 This node joined a swarm as a worker. ➜ eval $(docker-machine env swarm-3) ➜ docker swarm join --token SWMTKN-1-33zfeg2ppr9043o4itdn2cznwn7yuy7na1fqg2aduoemihw93o- 3znh32dbpmb5goc8l1ia286it 172.16.140.157:2377 This node joined a swarm as a worker.
  • 30. 30 That’s it, you now have a Swarm Cluster!!!!
  • 31. 31 Now it’s time to install the Cinder Driver on each Node • Install the driver • Copy over a config file • Start the daemon • Restart Docker
  • 32. 32 You can just use docker-machine from your laptop… ➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "curl –sSL https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | sh -" ; done ➜ for each in $(docker-machine ls -q); do; docker-machine scp cdd.config.json $each:~/config.json; done ➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "sudo cinder-docker-driver --config config.json > cdd.log 2>&1 &" ; done ➜ for each in $(docker-machine ls -q); do; docker-machine ssh $each "sudo Service docker restart" ; done
  • 33. 33 About that install…. Config file is just OpenStack Creds Creating a Service file for the driver has made it’s way up pretty far on the TODO list { "Endpoint": "http://172.16.140.243:5000/v2.0", "Username": "jdg", "Password": “ABC123", "TenantID": "3dce5dd10b414ac1b942aba8ce8558e7“ }
  • 34. 34 Now you can do cool things Let’s build the simple counter application • Redis container with Cinder Volume • Web front end to take user input We’ll run this as a Swarm service, so we can do things like scale it, drain-nodes and move the containers uninterrupted. All while persisting our Redis data
  • 35. 35 Create a Docker network first so the Swarm nodes have a layer to communicate on… ➜ eval $(docker-machine env swarm-1) ➜ docker network create demo-net Bd45fad9911005ce2ff8e311a2738681d179589d8d06989a136e8020bc5a8155
  • 36. 36 Launch our services, start with the Redis service… ➜ eval $(docker-machine env swarm-1) ➜ docker service create --name redis --network demo-net –-mount type=volume,src=counter-demo,dst=/data,volume-driver=cinder -p 6379:6379 redis This will: • Pull the Redis image if it’s not available • Get/Create the volume on the Cinder backend • Attach the Volume to the Swarm node • Partition, Format and Mount the Volume • Link the volume to the Redis Containers /data directory • Start the Redis Container
  • 37. 37 You can see the attached volume on the Swarm Node…. ubuntu@swarm-3:~$ ls /dev/disk/by-path/ ip-10.10.9.1:3260-iscsi-iqn.2010-01.com.solidfire:ayyb.uuid-59e99b3b-c7d6-45c2-924c- virtio-pci-0000:00:04.0 virtio-pci-0000:00:04.0-part1 Same as we do for Nova Compute nodes… nothing really different except we add the file system
  • 38. 38 Now, the web service/frontend… ➜ docker service create --name web --network demonet -p 80:80 jgriffith/jgriffith webbase This will: • Connect to our Redis container (regardless of what Swarm node it’s on) • Expose port 80 to all of the Swarm Nodes (access from any Swarm Node IP) • Count input/clicks and store them in the Redis DB