Consul connect Envoy proxy dynamic port

314 views Asked by At

We use AWS ECS with bridge network mode, it is the reason why we can't use static 21000 port for sidecar Envoy proxy, because we want to use sidecar Envoy proxy for each service. Unfortunately by some reasons we can't start using awsvpc network mode, so we have to find a way to use a dynamic port for Envoy proxy instead of 21000. Could someone take us some suggestion ?

1

There are 1 answers

0
Blake Covarrubias On

By default Consul auto-assigns the port used by Envoy from a configurable range; sidecar_min_port and sidecar_max_port.

You can override this and select a specific port by configuring sidecar_service.port in the service registration file. For example:

{
  "service": {
    "name": "web",
    "port": 8080,
    "connect": {
      "sidecar_service": {
        "port": 21200
      }
    }
  }
}