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

Add Master and Slave services in addition to Sentinel Service #626

Closed
hashemi-soroush opened this issue Jun 23, 2023 · 1 comment · Fixed by #627
Closed

Add Master and Slave services in addition to Sentinel Service #626

hashemi-soroush opened this issue Jun 23, 2023 · 1 comment · Fixed by #627
Labels

Comments

@hashemi-soroush
Copy link
Contributor

Feature Request: Master and Slave services

Some famous Redis service providers allow clients to directly connect to Redis instead of using Sentinel for finding Redis instances, for example, Scalegrid and DigitalOcean. On the other hand, the Spotahome Redis operator only supports Sentinel clients, because it doesn't create Kubernetes Service for the Redis itself.
If an organization decides to migrate from those to a Redis service operated by this operator, all clients must be changed to use Sentinel. This can add a heavy load to the migration and even possibly change the organization's mind.

proposed solution

We can add a single service that selects all Redis pods. But this might route write requests to Slave instances, resulting in data loss. Also, if we select only the Master instance, all requests (including the read requests) will be routed to the Master, resulting in poor resource utilization.

Since, at the time of routing using Kubernetes services, we can't determine whether a request is a write or a read one, in order to have better resource utilization, we might need to rely on the client to choose which type of instances it wants to send each request to. So, we need two services: one for the Master instance, and the other for all the Slave instances.

Since the role of each Redis pod is mentioned in its labels, we can simply use that label in the service pod selector.

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

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

@github-actions github-actions bot added the stale label Aug 8, 2023
@ese ese closed this as completed in #627 Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant