doyoubi / undermoon-operator

Kubernetes Operator for Redis cluster based on Undermoon
27 stars 2 forks source link

Load Balancing #50

Open oruchreis opened 2 years ago

oruchreis commented 2 years ago

Hi, I want to expose redis cluster outside of the kubernetes. I've added a load balancer service with these settings:

selector:
    undermoonClusterName: my-redis-cluster
    undermoonName: my-redis-cluster
    undermoonService: storage

When I connect with redis-cli via load balancer ip, it redirects to internal kubernetes resources which I cannot reach outside of kubernetes cluster:

> redis-cli -h 10.10.80.140 -p 5299 -c
10.10.80.140:5299> keys *
-> Redirected to slot [1320] located at my-redis-cluster-stg-ss-1.my-redis-cluster-stg-svc.redis-ns.svc.cluster.local:5299
Could not connect to Redis at my-redis-cluster-stg-ss-1.my-redis-cluster-stg-svc.redis-ns.svc.cluster.local:5299: Name or service not known

Is there any settings to make the redirection public available? Or how can I reach cluster outside of kubernetes cluster without port-forwarding?

doyoubi commented 2 years ago

Well, the redirection protocol does not work well with Kubernetes ingress. Kafka also has the same issue. I would suggest adding a Redis cluster proxy so that the client side does not need to do the redirection.

There are several redis cluster proxies:

I would suggest trying predixy and aster out.