No description
  • Go 33.8%
  • Shell 19.5%
  • HCL 16.5%
  • JavaScript 9%
  • CSS 7.8%
  • Other 13.4%
Find a file
oss-core-libraries-dashboard[bot] ddb6389ee9
[COMPLIANCE] Update Copyright and License Headers (#24)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2026-02-20 15:26:42 +05:30
demo-config-localhost Uses Consul 1.3 syntax and proxy commands 2018-11-08 16:09:00 -08:00
k8s [COMPLIANCE] Update Copyright and License Headers (#24) 2026-02-20 15:26:42 +05:30
services [COMPLIANCE] Update Copyright and License Headers (#24) 2026-02-20 15:26:42 +05:30
.gitignore Update to match Consul helm chart 0.29.0 and Consul 1.9 (#9) 2021-03-10 16:49:42 -05:00
docker-compose.yml [COMPLIANCE] Update Copyright and License Headers (#24) 2026-02-20 15:26:42 +05:30
envoy-manifest.json create an envoy manifest 2021-07-08 08:46:26 -07:00
LICENSE [COMPLIANCE] Update Copyright and License Headers (#24) 2026-02-20 15:26:42 +05:30
README.md Update to match Consul helm chart 0.29.0 and Consul 1.9 (#9) 2021-03-10 16:49:42 -05:00

Demo Consul 101

Demo code and microservices for the HashiCorp Consul 101 course.

Email training@hashicorp.com or see https://www.hashicorp.com/training for details.

Quickstart: Docker Compose

To run both microservices with Docker Compose (but without Consul), run docker compose up.

$ cd demo-consul-101
$ docker-compose up

You can view the operational application dashboard at http://localhost:8080

A subsequent evolution of the application would involve registering each service with Consul and using Consul DNS to configure services to discover each other.

Quickstart: Consul service mesh

If you have the Consul binary installed locally, you can use the following sequence of commands to run a demo mesh on your local laptop.

Start a local Consul dev agent with:

consul agent -dev -config-dir="./demo-config-localhost" -node=laptop

Start the dashboard-service in a separate shell session.

PORT=9002 go run ./services/dashboard-service/main.go

Start the counting-service in a separate shell session.

PORT=9003 go run ./services/counting-service/main.go

Start a second instance of the counting-service in a separate shell session.

PORT=9004 go run ./services/counting-service/main.go

Start the sidecar proxy for the counting-1 service instance in a separate shell session.

consul connect proxy -sidecar-for counting-1

Start the sidecar proxy for the counting-2 service instance in a separate shell session.

consul connect proxy -sidecar-for counting-2

Start the sidecar proxy for the dashboard service in a separate shell session.

consul connect proxy -sidecar-for dashboard

Now visit the application at localhost:9002.