I am learning StackExchange.Redis, and Kubernetes, so I made a simple .net core app that reads a key/value from a Redis master+2slaves deployed on kubernetes. (so, everything, Redis and my app, run inside containers)
To connect to redis I use the syntax suggested in the doc:
ConnectionMultiplexer.Connect("server1:6379,server2:6379,server3:6379");
However, if I monitor the 3 containers with redis-cli MONITOR, the requests are processed always from the master, the 2 slaves do nothing, so there is no load balancing.
I have tried also to connect to a Kubernetes load balancer service which exposes the 3 Redis containers endpoints, the result is that when I start the .net app the request is processed randomly by one of the 3 Redis nodes, but then always on the same node. I have to restart the .net app and it will query another node but subsequent queries go always on that node.
What is the proper way to read key/values in a load balanced way using StackExchange.Redis with a master/slave Redis setup?
Thank you