minhthong582000 / SOA-101-service-mesh

Service mesh example application using Hashicorp Consul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SOA-101-service-mesh

Consul Reference Architecture

architecture

Connect-Native App Integration

Service mesh using Consul Connect-Native

Service Mesh - Connect-Native App Integration

Service Mesh - Connect Configuration

Service Mesh - Connect-Native App Integration With Go

DNS Interface

Consul service discovery DNS

DNS Interface

Demo

Create counting services, increments counter each time the API is called.

Run:

make run

Test API:

# Send get request to counting client
$ curl localhost:8081/
{"count":2,"hostname":"4b2a8b9fd305"}

# Query server address
$ curl localhost:8081/query
192.168.208.7:8080

deploy

Intentions

Service Mesh - Intentions

Test intentions Client --x--> Server:

intentions

Test API:

# Send get request to counting client
$ curl localhost:8081/
Connect to server failed: Get "https://server.service.dc1.consul/count": 
remote error: tls: bad certificate

Key/Value Store

Centralized configuration.

Example 1

Go to Consul UI:

kv

Test API:

# Send get request to counting client
$ curl localhost:8081/kv?token=wassup/bro
wassup/bro: {
  "sup": "bruh"
}

$ curl localhost:8081/kv?token=not/exist
Value not found for key: not/exist

Example 2

Go to Consul UI:

kv2

Test API

# Send get request to counting client
$ curl localhost:8081/
{"count":5,"hostname":"4b2a8b9fd305","language":"ENG"}

TODO

  • gRPC
  • Broker/Message Queue
  • Service mesh using Envoy
  • Service mesh in kubernetes
  • API Gateway
  • Monitoring

About

Service mesh example application using Hashicorp Consul

License:Other


Languages

Language:Go 87.1%Language:Dockerfile 7.3%Language:Makefile 4.2%Language:Shell 1.4%