This repository supports my Dockercon talk and demo
Docker and IoT securing the server-room with realtime microservices by Alex Ellis
In this hack, we secure the data-center through a scaleable network of real-time sensors and microservices running Docker. Each rack in the server-room is filled with thousands of terabytes of priceless customer data, IoT lets us keep one step ahead and keep that data safe. The cluster deploys a set of smart sensors running the Docker Swarm agent to the rack panels.
Each sensor constantly samples the ambient temperature of the rack and sends a real-time alarm to the control room when levels rise above normal levels. An anti-tamper motion sensor picks up tiny vibrations and alerts the admins when someone is performing unscheduled maintenance on the equipment. A custom made RGB LED display made by Pimoroni for Dockercon shows the status of up to 8 racks in real-time.
Thanks for the support
A large percentage of the hardware for this hack is being supplied by Pimoroni.com - so a huge thanks to them for helping out. They also designed a brand new add-on board for the Raspberry Pi with 8 RGB LEDs just for this demo and gave me early access to their environmental sensing board - envirophat.
Come to the live demo at Dockercon for all the rest of the details. We'll have a time for Q&A come prepared!
Visualizing a production-ready load-balancer with LEDs and Docker Swarm
I'm not accepting pull-requests to the demo code at present, but feel free to fork it or re-use elements in your own projects in-line with the MIT license.
Log into the manager and start the Docker Swarm manager image and consul as a key-value store with this shell script:
$ datacenter-sensor/start_manage.sh
Log into each additional Pi Zero and launc the Swarm Agent:
$ datacenter-sensor/join/auto_join.sh
The Consul IP address has to be hard-coded into the systemd docker.service file and this batch file.
Enter: Docker-compose
Point the DOCKER_HOST environmental variable to the swarm manager and type in:
$ export DOCKER_HOST=tcp://manager1.local:2376
$ docker-compose up -d
Then once running you can scale up the sensor service to the number of sensor Pis in your network.
$ docker-compose scale sensor=4
Profit.
If you want to open the web-dashboard, then use docker-compose ps
to find where it has been placed in the swarm and which port has been dynamically assigned to it.
When you're done you can use docker-compose stop
to pause the demo or docker-compose down
to clean everything up.
Descending date of release.