Several Consul connect upstreams?

Hello,
Do you know how I can set several connect upstreams (with a port & destination each) ?

I can’t find anything but a single upstream in the docs, like that :

service {
      name = "count-dashboard"
      port = "9002"

      connect {
        sidecar_service {
          proxy {
            upstreams {
              destination_name = "count-api"
              local_bind_port  = 8080
            }
          }
        }
      }
    }

I guess I can :

  1. add a prefix to the url,
  2. send to a consul service-router using this prefix for the routing
  3. use the prefix_rewrite in the destination to remove the prefix I added

… but I wonder if there’s a more idiomatic way to do that.

best,
Matthieu

Ok, if someone is interested, you can actually put several upstreams stanza in the same connect :

     connect {
        sidecar_service {
          proxy {
            upstreams {
              destination_name = "svc1"
              local_bind_port = 11111
            }
            upstreams {
              destination_name = "svc2"
              local_bind_port = 22222
            }
          }
        }
      }

Hi @err0r500 I’m glad to see you found a workaround. There’s was also a recently closed issue (https://github.com/hashicorp/nomad/issues/6646) where this was fixed. That fix is scheduled to go out for the next release of Nomad (0.10.2)

Yeap… and actually, the name of the guy who opened this issue sounds pretty familiar to me :smile: I had problems in both directions …
Thanks for your response, I expect 0.10.2 (btw, you reached 100% of your milestones, it’s time to release it ! :slight_smile: )