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

[stable/redis-ha>][REQUEST] Use kubernetes cluster DNS instead of IPs for redis and sentinel annoucements #206

Open
lord-kyron opened this issue Jul 7, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@lord-kyron
Copy link
Contributor

lord-kyron commented Jul 7, 2022

Is your feature request related to a problem? Please describe.
Since kubernetes has internal cluster DNS, cluster addresses can be used instead IP addresses for announcements for redis and sentinel
Describe the solution you'd like
For example in sentinel config, instead of sentinel monitor mymaster IP_ADDRESS 6379 2 it can be configured to use sentinel monitor mymaster MASTER_POD_NAME.NAMESPACE.svc.CLUSTER_DOMAIN 6379 2
I Assume this can be achieved using getent hosts HELM_RELEASE_NAME.redis-ha-server-0.HELM_RELEASE_NAME-redis-ha.NAMESPACE.svc.CLUSTER_DOMAIN | awk '{print $2}' for defining the announce_ip function in the scripts.
Describe alternatives you've considered
As alternative the DNS of the service, not tne pod can be used

Additional context
If cluster DNS is used, we can remove the announce services which are created alongside the headless service and despite of that, keep the high-availablity because pods DNS names are also kept the same when respawning pods. IPs are changing, pod pod names are not.
This way the same functionality can be kept to work as it is now but less resources can be used (lower the deployment footprint removing announce services)

@DandyDeveloper what do you think?

@lord-kyron lord-kyron added the enhancement New feature or request label Jul 7, 2022
@elchenberg
Copy link

According to the docs this is possible since Sentinel 6.2 with sentinel resolve-hostnames yes: https://redis.io/docs/manual/sentinel/#ip-addresses-and-dns-names

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

No branches or pull requests

2 participants