Edit - Is it even possible to achieve it or I should be looking into something else?
How can I integrate envoy with consul for automatic service discovery and routing? I've the containers running in docker and each container is registering with the consul at run time.
My docker-compose file looks like this.
version: '3'
services:
consul:
image: consul:1.6
container_name: consul
ports:
- 8300:8300
- 8400:8400
- 8500:8500
envoy:
container_name: envoy
build:
context: ./envoy
dockerfile: Dockerfile
ports:
- 10000:10000
user:
container_name: user
build:
context: ./user
dockerfile: Dockerfile
Let's say user is registered to consul with the Id foo
running at port 80
and the request to the envoy proxy comes as http://localhost:10000/user
envoy/envoy.yaml
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9901 }