consul connect proxy - connecting upstream to specific instance of service

28 views
Skip to first unread message

Pavel Chernikov

unread,
Jun 3, 2020, 2:00:14 AM6/3/20
to Consul
I'm trying to expose a service using consul connect and having trouble wrapping my head around the following:

I have multiple instances of svc1 registered (different versions of svc1), with different service IDs

Looking to use consul connect to connect to a specific instance of the service, with ID svc1-test1

The -sidecar-for part is working fine, as it takes service ID as argument:
consul connect proxy -sidecar-for svc1-test1

Now when I tried to run the following:
consul connect proxy -service local-svc1 -upstream svc1:18893

I realized that I don't have ability to specify the instance of svc1 I want (with ID svc1-test1), and can only specify svc1 which is the service name.

Am I missing some key concept here or is what I'm trying to do impossible with consul connect when I register the services with same name, and I should be registering services using different names (i.e. making service name and ID the same) - "svc1-test1"?

Hope this was clear enough...


Reply all
Reply to author
Forward
0 new messages