OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
793 stars 217 forks source link

[Proposal] Can we support returned master address can be accessed from out of cluster ? #528

Open samzong opened 1 year ago

samzong commented 1 year ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

I would like to be able to access the Redis master node from outside. To achieve this, I suggest adding an accessmode parameter when creating a CR using the operator. When the access mode is set to "outside", the default access address returned should be the NodePort IP of the node where the master instance is located.

Describe alternatives you've considered

My current alternative solution is to create a service (svc) for external access and have an operator use listwatch to obtain the master node of the Sentinel, dynamically updating the endpoint information for the svc.

What version of redis-operator are you using?

redis-operator version:

Additional context

v0.14.0

ats-aigc commented 1 year ago

I think it's a good idea. cc @iamabhishek-dubey

sedadas commented 1 year ago

My usecase is connected to this as well. We are using MetalLB to expose Redis to our users. Recently, I attempted to expose a Redis cluster instead of a single instance and, while it worked, the applications would get connected to a read-only replica and return an error. Thus, from my point of view, which is also in line with the proposal above, it would be helpful to add at least labling about which pod is the current master in the cluster.

isaru66 commented 1 year ago

Currently, I use the work arround by deploying https://github.com/oblakstudio/redisinsight, which expose Redis in a web gui interface (redis-insight => redis , similar to kibana => elastic ). Then, we deploy oauth proxy to secure it.

Btw, redisinsight only work for management task. if we can access redis from outside cluster it will simplified the application development so that we do not need a port-forward anymore.

It would be great if we can access Redis cluster from outside the kubernete cluster.