Clusterfuck is a library for setting up a networked cluster of servers to test failure conditions against. It's a library to fuck with clusters.
Currently it ships with a DSL for EBGP leaf-spine architectures, but has a generic backend that allows configuring any topology.
It's currently using Virtualbox for probably no good reason other than
network_lab, which this works derives from, used it. VMWare will be
investigated in the future.
vagrant-clusterfuck Vagrant plugin:
$ vagrant plugin install vagrant-clusterfuck
cluster.rb file to define your cluster (see below). This must be a separate file,
because it needs to be loaded in your test environment which does not implement
the Vagrant DSL.
Vagrantfile, build your cluster:
cluster = ::[:test] cluster[:host1].build(config) do |box| box.vm.provision :shell, inline: "echo 1 > /tmp/test" end cluster[:host2].build(config)
For a complete example, see the
cluster.rb in this
$ vagrant up --provider virtualbox
When making changes to
Vagrantfile make sure to reload and
reprovision the cluster:
$ vagrant reload --provision
Defining a cluster consists of two steps:
- Creating instances. You must specify which VMs your topology requires.
- Layer 2 network. You must specify the relationships between the VMs, that is, the layer 2 network of which nodes belong to the same subnets and can thus directly communicate with each other.
./cluster.rb for an annotated example. In the future we may build
DSLs on top of the low-level graph DSL.