New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection to Redis Cluster in Minikube #21
Comments
Here's the commands and Helm .yaml file I used if you'd like to replicate my setup:
(Helm chart link: https://artifacthub.io/packages/helm/bitnami/redis-cluster) |
Hi @ConstBur, thanks for the kind words. (Editing this comment after learning that the docker driver was being used...) See the recent comment on minikube and clusters. In terms of stream support - I'm looking to get that released in the next couple of weeks. I'm almost done with 5.0.0 (currently on the feat/resp3-support branch) and then streams are next up right after that. Version 5 is a major rewrite with traits instead of my unsustainable attempts to get by with |
TLDR: I think the issue is due to the IP addresses from the In terms of fixing or working around it (in order of complexity):
In the meantime I'll look into a one-size-fits-all solution that can be added to Fred if possible, since this is probably a common issue. Redis is uniquely ill-suited for running inside a virtual network where the client is outside that network with limited access to the network inside minikube. At the very least I should probably add a bit to the README about why Redis clusters and minikube can be problematic. |
Wow, that's a very detailed response, thank you very much! I've tried adding I have a server that I can use for hosting Kubernetes, so I'll try setting that up in the meantime. Should I leave this issue open until there's a solution found/README note written? |
Oh that's good news if you're using the docker driver on linux. You have much more control over how the networking is set up in that case. You could probably dockerize the build command you use and everything would likely work (assuming you run the docker command with the same network as your minikube cluster). Regarding the logs issue - try adding I'll edit my comment to reflect the fact that you're using docker, since things are bit different in that case. In the end though the general idea of using a central load balancer with redis tends not to work very well. Redis will tell clients to connect to specific IP addresses, and when you're using any form of a reverse proxy that tends not to work. Elasticache (the AWS managed Redis service) does quite a bit of work to make this smooth for callers, but from what I understand they had to customize both Redis and their load balancer to do what you're looking to do. |
@ConstBur I wrote two docs that will probably help answer some of your questions. They're currently on the https://github.com/aembke/fred.rs/blob/feat/resp3-support/FAQ.md Also, I just went ahead and did the streams interface with this next release, so that should be up on crates.io in the near future. |
Holy crap, you explained everything like I'm 5 and in great detail at the same time! Alright, I'm definitely switching to a centralized server then since I can. Logs now work, but not much interesting appears in them:
I'll close this issue then, everything's clear now. Can't wait for the next release! |
Hello Alec, I have a problem connecting to a local Redis cluster created in Minikube. If the problem isn't on Fred's side let me know :)
The setup is relatively simple: there's a single LoadBalancer exposed via minikube tunnel that redirects to a cluster node, and the cluster itself isn't accessible from outside (so the nodes can only talk to each other and the load balancer). Here's the commands I used:
Using redis-cli on the host with load balancer IP
10.102.101.213
like so:all works as expected.
Trying to connect to the same cluster with Fred (env variable REDIS_URI is the LoadBalancer IP):
makes it throw this error:
Given that the info about nodes in cluster is gathered with CLUSTER NODES (per https://docs.rs/fred/latest/fred/types/enum.ServerConfig.html#variant.Clustered), I assume passing a single IP is fine.
I guess this is some kind of a DNS/redirect resolution problem. I see that you're currently working on supporting custom DNS resolvers on the client, could this be related?
Keep up the great work, this is probably the best Redis driver for Rust at the moment!
P.S. When do you plan to release Streams functionality by the way (in terms of time)?
The text was updated successfully, but these errors were encountered: