Stephen Nguyen a Developer Evangelist for ClusterHQ reviews how volumes work and overviews the benefits of allowing Flocker to orchestrate your Volumes. (video coming soon)
2. Hi my name is Stephen
I’m a developer evangelist
at ClusterHQ
I was previously at Iron.io
advoca<ng stateless workloads
3.
4. docker docs…
• Volumes are ini.alized when a container is created. If
the container’s base image contains data at the
specified mount point, that exis.ng data is copied into
the new volume upon volume ini.aliza.on.
• Volumes can be shared and reused among containers.
• Changes to a volume are made directly.
• Changes to a volume will not be included when you
update an image.
• Volumes persist even if the container itself is deleted.
External Volumes
5. docker run -v /data ubuntu
docker run -v /data2 ubuntu
host
/DATA /DATA2
Volumes inside a
container
7. Mount a host directory as a data volume
docker run -v $HOME:/data ubuntu
host
$HOME/data
8. Mount a host directory as a data volume
host
docker rm <container_id>
$HOME/data
9. Mount a host directory as a data volume
$HOME/data
host
docker run -v $HOME:/data ubuntu
10. Mount a host directory as a data volume
/data
docker run -v /data ubuntu
coreos-‐host-‐node—1 coreos-‐host-‐node—2
11. That container is not guaranteed to
be scheduled to that host
/data
coreos-‐host-‐node—1
/data
My data is still here! fresh host volume :(
coreos-‐host-‐node—2
docker run -v /data ubuntudocker run rm <container_id>
12. That container is not guaranteed to
be scheduled to that host
/host/logs/container/logs
coreos-‐host-‐node—1
/host/logs/container/logs
My data is still here! fresh host volume :(
coreos-‐host-‐node—2
copy host
volume?
13. • Keep track of Host Volumes?
• What if the volume is extremely large?
• BitTorrent Sync?
• Use NFS? GlusterFS? OtherDistributedFileSystemFS
Problems to address
17. Limita<on of ~40 EBS volumes to a Linux Host
before Boot Failures become a thing
coreos-‐host-‐node—1
18. • MounKng correct ebs volumes to the correct
containers/host machine
• Provisioning EBS volumes happens manually not
dynamically
• you need to interact with the the AWS EBS API or
Console
Problems to address
33. • All Flocker services to be Containerized
• run our containers in “privileged” mode
• When the operator executes docker run -‐-‐privileged
• We need to to communicate the state of mounted
volumes to the host system back to our containerized
flocker service
Problems to address to get this
to work on CoreOS
35. Installing the tools across all cores nodes was
brainlessly easy with our uft-flocker tool
$ uft-flocker-install cluster.yml
$ uft-flocker-config cluster.yml
$ uft-flocker-plugin-install cluster.yml
$ # boom shaka laka
Making installa<on of all the
pieces easier
36. wrapping flocker in nsenter
wrap commands that interact with host with nsenter `mount`,
`umount`, `lsblk`, `losetup`
https://github.com/jpetazzo/nsenter
37. nsenter
it can enter existing namespaces, or
spawn a process into a new set of
namespaces.
https://github.com/jpetazzo/nsenter
41. Thanks to
ClusterHQ team
Madhuri Yechuri / Luke Marsden /Kai Davenport
CoreOS (for teaching us how our services would
work in a dockerized format)
Giant Swarm (for pushing us forward)
Jérôme Petazzoni (nsenter _w)