just to get that right: If I use the LoadBalancerIPs to connect to a replicaSet, how does the mongodb-cluster answer with the right LoadBalancerIP for the master instead of answering with the Pod-IP?
There is another point: When using transactions, the connection to the mongos-pods via the k8s-clusterIP seems not to be ideal. As the k8s-services works as a loadBalancer in front of the mongos, the transactions fail. We run into the same issue as https://jira.mongodb.org/browse/CSHARP-3301
I am wondering if this would be better with connecting via a headless service, but I haven’t got this working yet.
Yes, servicePerPod was created exactly for the case where you have long running transactions and they can fall under different cursors / mongos pods.
As for not scalable - what do you mean? Do you mean that if you scale mongos from 3 to 5 nodes your certs will not be there? Or that your application will need reconfiguration?
In our experience mongos sizing is quite static as it is just a proxy and they do not consume a lot of resources, so scaling is rare.