I am using Kubernetes services with custom endpoints to access external redis cluster.
But I can't know which one is master and I want to ensure it only forward incoming connections to reach a master.
Is there anything in Kubernetes I could use for checking nodes and to get master?
This is piece of code from haproxy that does the job I need
backend redis ....
tcp-check send info\ replication\r\n
tcp-check expect string role:master ...
If I understand correctly, you are looking for a native k8s solution to detect which of external redis nodes are master nodes and point traffic to them.
My answer is: There is no way to do it natively.
You need to use some custom solution (such as your haproxy) to achieve it.