Scale a service with sidekicks

Suppose I have service A with sidekick B.

A is suppose to consume the http service from sidekick B by looking up B by dns name “B”.

Now, when I scale up this service to 2, using “B” to lookup sidekick B will result in 2 different IP addresses.

Is there a way to have service A to only resolve the IP to its sidekicks?

@nlhkh you would have to use rancher-metadata to get information about your sidekick deployed on the same host. I’ve put more description in the comment to this post: Sidekick how detect primary service (container)?

hope it helps