mocofound / demo-consul-101

Tutorial code and binaries for the HashiCorp Consul beginner course.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 Connect

More documentation is coming. In the meantime, you can start a local demo with:

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

Then start instances of dashboard-service and counting-service

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

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

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

consul connect proxy -sidecar-for counting-1
consul connect proxy -sidecar-for counting-2

consul connect proxy -sidecar-for dashboard

About

Tutorial code and binaries for the HashiCorp Consul beginner course.


Languages

Language:Go 32.9%Language:Shell 16.0%Language:HCL 14.9%Language:Makefile 13.8%Language:JavaScript 8.6%Language:CSS 7.3%Language:HTML 4.0%Language:Dockerfile 2.5%