Lets assume I have 3 pods that need to talk to eachother (like a mongodb replicaset, I know Im not suppose to use plain pods for that ).
When I initiate a mongodb repliaset I do so like this (https://docs.mongodb.com/manual/tutorial/deploy-replica-set/):
This will not work with consul though since the mongodb container only talks over localhost to the injected envoy proxy.
But then I have todo someting like this:
I am forced to use different ports since the address is 127.0.0.1 to go via the envoy proxy. This means the other replicas will need to bind to weird mongo ports like 27018 and 27019.
It would be nice if instead of 127.0.01 you could use some kind of dns name like the picture above.
I would like to have something like this:
Then the mongo-1 upstream could be
But there are port collisions and stuff here I get that, not sure if there is a good solution for this.
What I do now is basically bind my different mongos to ports like 27018 and 27019 but I would like to avoid this if possible.
Thanks in advance, have a great weekend!