A cluster (Bramble) of Raspberry Pis on which Drupal will be deployed using Ansible and Kubernetes.
Read the rest of this README and the official Dramble Wiki for more information about the Dramble.
I'm doing presentations on Ansible, and how easy it makes infrastructure configuration, even for high-performance/high-availability Drupal sites. WiFi/Internet access is spotty at most conferences, so deploying to AWS, DigitalOcean, or other live public cloud instances that require a stable Internet connection is a Bad Idea™.
Deploying to VMs on my own presentation laptop is an option (and I've done this in the past), but it's not quite as impactful as deploying to real, live, 'in-the-flesh' servers. Especially if you can say you're carrying around a datacenter in your bag!
A cluster of servers, in my hand, at the presentation. With blinking LEDs!
You can browse more information about geerlingguy's Dramble on http://www.pidramble.com/. This website is actually running on the Rasbperry Pi Dramble cluster pictured above!
- 24 ARMv7 CPU Cores
- 5.4 GHz combined compute power
- 6 GB RAM
- 96 GB microSD flash-based storage
- 1 Gbps private network
Many people have asked for a basic list of components used in constructing the Dramble, or where I found particular parts. In the Wiki, I've added pages listing the following:
The process for setting up all the Raspberry Pis is outlined in the Wiki:
- Prepare the Raspberry Pis for provisioning
- Rack the Raspberry Pis
- Network the Raspberry Pis
- Test the Ansible configuration
- Provision the Raspberry Pis - TODO: This documentation needs updating for Kubernetes.
- Deploy Drupal to the Raspberry Pis - TODO: This documentation needs updating for Kubernetes.
Until the official Pi Dramble Wiki is updated (see TODOs above), this section of the README should suffice for setup steps for someone familiar with command line usage.
-
Install Ansible role dependencies:
ansible-galaxy install -r playbooks/requirements.yml --force
-
Run the main playbook to install Kubernetes on all the Pis and configure the cluster:
ansible-playbook -i inventory main.yml
-
You can SSH into the Kubernetes master (10.0.100.61 by default) and run
kubectl
by switching to the root user (sudo su
). For example:kubectl get nodes kubectl get pods ...
-
Edit your
/etc/hosts
file and add the line:cluster.pidramble.test 10.0.100.62
-
After that, you can access the
drupal8
Kubernetes service at the URL:http://cluster.pidramble.test/
. -
To install Drupal 8, use the database username
drupal
, the database namedrupal
, the MySQL server URLdrupal8-mysql
, and the database password defined in yourconfig.yml
file.
Note that for the hosts file, you can point the domain at any of the non-master nodes (e.g.
10.0.100.62
,10.0.100.63
, etc.); they are all running the Traefik ingress controller as a Kubernetes DaemonSet, meaning any single host can direct traffic on port 80 to thedrupal8
service. Technically, you could use DNS round robin to point one domain at all the Pis, but the best solution is to have another load balancer in front of all the Pis, redirecting the traffic to them using a more intelligent load balancing and health monitoring solution.
The Pi Dramble includes a built-in Docker registry that is used to host Drupal images for deployment to Kubernetes. To use the Docker Registry manually (to push or pull images):
-
Edit your
/etc/hosts
file and add the line:registry.pidramble.test 10.0.100.62
-
Configure Docker to work with
registry.pidramble.test
as an insecure HTTP registry.
Eventually, the registry will be secure (see GitHub issue TODO), but for now the Dramble uses an insecure HTTP registry for ease of installation.
See the Pi Dramble Benchmarks section of the Wiki for current benchmarks and statistics.
A Vagrantfile is also included for local testing and debugging of the Kubernetes cluster and manifests using Vagrant. See the Vagrant README for more details.
If you have only a single Raspberry Pi, you can use the Drupal Pi project to quickly get Drupal running on the single Pi.
The Raspberry Pi 2, 3, and 3 B+ have quad-core processors that make certain operations four to ten times faster than single-core Pis like the A+, B+, Zero, etc. Additionally, cluster members need as much RAM as possible, and any Pi without at least 1 GB of RAM is woefully underpowered for this setup.
Therefore only the following Pi models are officially supported at this time:
- Raspberry Pi model 3 B+
- Raspberry Pi model 3 B
- Raspberry Pi model 2
This project was started in 2015 by Jeff Geerling, author of Ansible for DevOps.