/consul-connect-sidecar-example

Hashicorp Consul Connect Sidecar Example

Primary LanguageDockerfileMIT LicenseMIT

consul-connect-sidecar-example

Hashicorp Consul Connect Sidecar Example

Requires

  1. Hashicorp Consul 1.4.0
  2. Docker
  3. docker-compose
  4. Python flask
  5. Golang

Install

Install Consul

Install Docker

Install docker-compose

Install Golang

Install Python Framework flask according to the platform of each LInux OS.

Usage

Consul

Start / Stop Consul Process

$ systemctl start consul
$ systemctl stop consul

Consul Sidecar

Start Side Car

  1. hoge
$ consul connect proxy -sidecar-for hoge
  1. page
$ consul connect proxy -sidecar-for page

Consul Sidecar Proxy

  1. nginx
$ consul connect proxy -sidecar-for nginx

Confirm

$ curl http://localhost:<SERVICE?PORT>/hoge
$ curl http://localhost:<SERVICE?PORT>/page