A vagrant cluster demoing a single "demo" service discovering one of two "foo" services.
The vms are provisioned with vagrant and puppet, the foo services are registered using a service definition config provided by the consul puppet module, and the demo service discovers "foo" through the dns server provided by the consul agent. Dnsmasq is leveraged to integrate the consul dns server so vanilla dns requests can be used.
A single demo application is used for the "demo" service and two "foo" services (it contains a "DemoResource" and a "FooResource") to make tinkering with the demo easier.
Make sure you have copies of Vagrant and Composer installed.
git clone https://github.com/fliglio/fliglio-consul-vagrant.git
cd fliglio-consul-vagrant
./puppet-deps.sh
composer create-project fliglio/consul-app --dev demo
vagrant up
puppet-deps.sh
will pull in puppet module dependencies in./puppet/modules
for vagrant to leveragecomposer create-project...
installs the demo php app in./demo
(the vagrant vhosts will point to this)vagrant up
will stand up your cluster
- Dashboard
- Demo
Refresh the demo page a few times and see the foo svc ip change as it resolves the service via. consul.