Skip to content
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

Service pointing to master node #76

Closed
asuvorkin opened this issue Aug 29, 2018 · 8 comments
Closed

Service pointing to master node #76

asuvorkin opened this issue Aug 29, 2018 · 8 comments
Labels

Comments

@asuvorkin
Copy link

Is it possible to configure a service directly pointing to the Master node of Redis in failover?
Or may be to have Operator put and update label 'Master' according to the current master node from Sentinel? So if failover happens Operator removes the label from previous Master and moves it the new one.

@rhefner1
Copy link
Contributor

What's the use case for that? Using a Redis client without Sentinel support?

@asuvorkin
Copy link
Author

yes. Let's say I need to upload batch file to Redis using redis-cli which is out my k8s cluster

@rhefner1
Copy link
Contributor

Sure, I understand but exposing the Redis master with a public service probably isn't the best thing. IMO a better way to do that is either through VPN (I use this one in my cluster) so redis-cli can connect directly to it or using remote storage as a backend (upload from local machine to S3, download from S3 into temporary pod, upload from temporary pod into redis).

You can kind of fake sentinel support in redis-cli by doing the following:

redis_master_ip=$(redis-cli --raw -h rfs-staging-manager-redis-ha.staging.svc.cluster.local -p 26379 sentinel master mymaster | sed -n 4p)
redis-cli -h ${redis_master_ip} -p 6379

@asuvorkin
Copy link
Author

Right, in this case redis_master_ip will be ip of pod running the Master, and I want to access it from our private network, not through Internet.
I'm running k8s cluster on premise, not on Amazon, Azure etc.

@dustinchilson
Copy link

I also have a need for something like this, our client does not support sentinel and I am hosted on a cloud provider. I'd like use an ingress to route into the master redis node from outside the cluster.

If the Operator where monitoring sentinel and labeling the redis pods as master/slave then a service could just point to the master which negates the need for twemproxy.

Client -> Ingress IP -> redis master service.

Or

Could we consider deploying something like tuananh/kubernetes-twemproxy as part of the operator? This uses sentinel to determine which redis node is master and use that one for connections.

Client -> Ingress IP -> twemproxy service -> sentinel -> redis master.

@jchanam
Copy link
Collaborator

jchanam commented Sep 21, 2018

I agree with @rhefner1, the idea of using a Redis Failover is accessing always over Sentinel. @asuvorkin if you want to access from outside the cluster, you should have other piece, external to the Redis, to allow doing so.

@dustinchilson that is out of the scope of the Redis Operator. The way of doing that is having an external piece as you're proposing. You can directly deploy together a redis-failover and that software, there's no need of update on the operator to do so.

@github-actions
Copy link

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label Jan 14, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants