This is the project that is used for my ChefConf 2019 talk on Consul and Habitat.
In all, this demo consists of 6 containers: counter service, dashboard service, Consul client, Consul server, and 2 Envoy sidecar containers.
-
Ensure the
consul:latestis pulled down locally. -
Ensure the
errygg/consulpackage is built and pushed to Habitat Builder. -
First we'll build all the Habitat packages and export them as Docker containers
> cd services/counter
> hab studio enter
$ build
$ hab pkg export docker ./results/<.hart file>> cd services/dashboard
> hab studio enter
$ build
$ hab pkg export docker ./results/<.hart file>> cd services/consul-client
> hab studio enter
$ build
$ hab pkg export docker ./results/<.hart file>- Run
docker-composeto setup all the initial containers (without Envoy)
> cd compose
> docker-compose up- Browse to all the services and ensure they are running
Consul Server: http://localhost:8500 Counter Service: http://localhost:8080 Dashboard Service: http://localhost:TBD
- Start the dashboard app and register it with Consul (with the Consul agent
running alongside the counter app). Start the dashboard with
COUNTING_SERVICE_URLset to the DNS endpoint for the counter app (counter.consul.service).
hab ...- Deploy the Envoy proxy to each of the counter and dashboard habitat apps.
???- Flip the switch in the consul config file to use Consul Connect
???Great, now we know how Habitat apps work with Consul Connect and Envoy and we've secured our connections... on our laptop. What about a real environment.
-
Spin up a K8 cluster with Consul Helm
-
Spin up some VMs and register them with Consul in K8s
-
Deploy the counter application to K8 w/ Consul and Envoy
-
Deploy the dashboard application to the VMs w/ Consul and Envoy
-
Show the awesomeness...
+-----------+ | Counter | | Service | | | +-----------++--------+ +---------+ | Consul | | Consul | | Agent +<----------->+ Server | | | | | +-----------++--------+ +---------+ | Dashboard | | Service | | | +-----------+
Guide on how to create Habitat Wrapper Plans
Example Habitat Wrapper Plan for Vault
Consul Service Checks
Current work-in-progress plan for modifications to core/consul
Consul Service Definitions
Consul Connect Demo
Consul and Docker blog
Consul 101 demo including the counting and dashboard services
Official Consul Docker image
Docker Compose
Example Consul Docker Compose file
Example Consul Client Habitat package
Creating TLS Certificates for Consul