[ClusterLabs] Coming in Pacemaker 1.1.17: container bundles
Ken Gaillot
kgaillot at redhat.com
Fri Mar 31 22:43:02 UTC 2017
Hi all,
The release process for Pacemaker 1.1.17 will start soon! The most
significant new feature is container bundles, developed by Andrew Beekhof.
Pacemaker's container story has previously been muddled.
For the simplest case, the ocf:heartbeat:docker agent allows you to
launch a docker instance. This works great, but limited in what it can do.
It is possible to run Pacemaker Remote inside a container and use it as
a guest node, but that does not model containers well: a container is
not a generic platform for any cluster resource, but typically provides
a single service.
"Isolated resources" were added in Pacemaker 1.1.13 to better represent
containers as a single service, but that feature was never documented or
widely used, and it does not model some common container scenarios. It
should now be considered deprecated.
Pacemaker 1.1.17 introduces a new type of resource: the "bundle". A
bundle is a single resource specifying the Docker settings, networking
requirements, and storage requirements for any number of containers
generated from the same Docker image.
A preliminary implementation of the feature is now available in the
master branch, for anyone who wants to experiment. The documentation
source in the master branch has been updated, though the online
documentation on clusterlabs.org has not been regenerated yet.
Here's an example of the CIB XML syntax (higher-level tools will likely
provide a more convenient interface):
<bundle id="httpd-bundle">
<docker image="pcmk:httpd" replicas="3" />
<network ip-range-start="192.168.24.112" host-netmask="24">
<port-mapping id="httpd-port" port="80"/>
</network>
<storage>
<storage-mapping id="httpd-root"
source-dir="/srv/www"
target-dir="/var/www/html"
options="rw"/>
<storage-mapping id="httpd-logs"
source-dir-root="/var/log/pacemaker/bundles"
target-dir="/etc/httpd/logs"
options="rw"/>
</storage>
<primitive id="httpd-apache"
class="ocf" provider="heartbeat" type="apache"/>
</bundle>
With that, Pacemaker would launch 3 instances of the container image,
assign an IP address to each where it could be reached on port 80 from
the host's network, map host directories into the container, and use
Pacemaker Remote to manage the apache resource inside the container.
The feature is currently experimental and will likely get significant
bugfixes throughout the coming release cycle, but the syntax is stable
and likely what will be released.
I intend to add a more detailed walk-through example to the ClusterLabs
wiki.
--
Ken Gaillot <kgaillot at redhat.com>
More information about the Users
mailing list