Giter VIP home page Giter VIP logo

demo-consul-101's Introduction

Demo Consul 101

Demo code and microservices for the HashiCorp Consul 101 course.

Email [email protected] 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.

demo-consul-101's People

Contributors

topfunky avatar angrycub avatar marcaurele avatar tryan225 avatar derekstrickland avatar shoenig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.