-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[bitnami/redis] I want to connect to Redis Sentinel from outside k8s. #24539
Comments
The issue may not be directly related to the Bitnami container image or Helm chart, but rather to how the application is being utilized or configured in your specific environment. Having said that, if you think that's not the case and are interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here. Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance. If you have any questions about the application itself, customizing its content, or questions about technology and infrastructure usage, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology. With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights. |
Thank you for quick reply.
Even if you enter the node IP in the Sentinel extraEnvVars setting, it is not reflected in the actual Sentinel. sentinel:
count: 3
masterSet: sentinelmaster
service:
type: NodePort
nodePorts:
redis: "30211"
sentinel: "30311"
extraEnvVars:
- name: REDIS_MASTER_HOST
value: 10.150.xxx.xxx
- name: REDIS_MASTER_PORT_NUMBER
value: "30289" If I can preserve the IP information returned by Sentinel from "test-redis-sentinel-node-0.redis-sentinel" to "10.150.xxx.xxx", |
@carrodher I went through the settings below "externalMaster.enabled: true" but I am constantly getting logs like the one below in Sentinel...
|
I, too, am looking for a solution to connect to Redis Sentinel from outside the K8s cluster. I'm configuring the service type as LoadBalancer and it seems to initially connect but as soon as I try to do any command GET, SET,DEL, etc. it fails. The issue seems to be that sentinel is sending back the internal K8s names to the Redis client, which won't work outside the K8s cluster.
And then the application is encountering an error trying to do SET operation
Is there a way to configure it where it uses IPs instead of host names? We are using Azure CNI model so all ours pods have an IP on our subnet so they are directly accessible. |
see https://github.com/bitnami/charts/issues/16436#issuecomment-1541911310 add record to /etc/hosts it works fine~ |
That doesn't work for the official Go Redis client; it still tries to do a lookup on the hosts even with the entries in the hosts file. dial tcp: lookup redis-badges-node-0.redis-badges-headless.redis.svc.cluster.local: i/o timeout |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Any solution to this that does not involve editing the hosts file? |
In other charts we have the |
As others have described, depends on whether that would work with Sentinel as it returns hostnames, not IPs, and I can't use hostnames/IPs that are cluster-internal. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
Why did the bot close this when there clearly was activity? |
Hi there, If you would like to contribute by implementing a feature similar to what already exists in the |
it is actual problem !!!! |
I am facing the same issue. Whatever you configure, when you get the primary from a sentinel it is either a cluster private IP or a hostname that even if configured with external-dns still resolves as a private pod IP address, even if k8s nodes have a public IP address. As other have mentioned, would be really great to have a way to get sentinels to return a public IP address. Most probably by deploying a load balancer per primary and using this load balancer IP. That's what I expected when I used |
Any possible solutions for this issues? Will be much appreciated, we are planning to host Redis in AKS and access outside the cluster. We can make the sentinel service in type load balancer and it returns pod private IP which will not be accessible outside the cluster 😔. |
For those seeking a solution, I have addressed the challenge by adding the following parameters to the sentinel:
masterService:
enabled: true
type: LoadBalancer
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
external-dns.alpha.kubernetes.io/hostname: "redis-master.aks-privatedns.com"
external-dns.alpha.kubernetes.io/ttl: "60" |
Name and Version
bitnami/redis 17.6.0
What architecture are you using?
amd64
What steps will reproduce the bug?
When using redis-cli, both redis and sentinel are connected normally.
Using java lettuce, we try to connect to the Sentinel k8s domain as follows.
-> It is possible to connect directly to redis using the host IP.
-> However, if you connect using Sentinel method, an error occurs.
What is the expected behavior?
After activating nodeport, you must be able to connect to the node port or host IP, not the k8s service domain.
What do you see instead?
I enabled the node port in Sentinel, but it still returns the k8s service address and cannot be accessed from outside k8s.
Additional information
I would like to know the settings for connecting to redis sentinel from outside without using a separate open source(ex haproxy).
The text was updated successfully, but these errors were encountered: