I've installed the Bitnami\Redis helm chart on a cluster with the value of master.kind = DaemonSet. Now I have a redis pod for each node. like this
NODE A-REDIS-POD-ANODE B-REDIS-POD-BNODE C-REDIS-POD-C
The chart installed three services:
redis-internal-master(1 IP address)redis-internal-replica(1 IP address)redis-internal-headless(3 IP addresses - mapped for each pod)
I have an app - MYAPP - running in NODE C. How can I connect to the redis pod that's running on NODE C? I can use the master-service IP address but I don't know where that sends me really (does it send me to a different one each time? then data won't be consistent).
I can fetch the 3 IP addresses of the headless service using getent hosts redis-internal-headless.default.svc.cluster.local but then how the hell do I know which one is running on the same node as MYAPP?
My nodes change too, I have autoscaling, nodes can come and go. How do I make sure every app on NODE A always connects to REDIS-POD-A, every app on NODE B to always connect to REDIS-POD-B, etc.?
I thought this would be pretty trivial, but it turns out to be pretty complicated? I'm losing my hair trying to figure this out. Please help