undermoon-operator
undermoon-operator copied to clipboard
Load Balancing
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?
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:
- official redis-cluster-proxy but not maintained now
- predixy
- aster
- corvus Need to change some codes to support long domain in k8s.
I would suggest trying predixy and aster out.