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

[bitnami/redis] External access to cluster in Master-Replicas with Sentinel topology #25236

Closed
iamalryz opened this issue Apr 19, 2024 · 2 comments
Assignees

Comments

@iamalryz
Copy link

Name and Version

bitnami/redis

What is the problem this feature will solve?

Despite there is an ability to use LoadBalancer service in Master-Replicas with Sentinel topology, we cannot get access to Redis installation from outside of K8s, because sentinel returns to clients just internal K8s FQDN of master Pod.

E.g.:

# Redis installation in 'Master-Replicas with Sentinel' topology
kubectl -n redis get po
NAME           READY   STATUS    RESTARTS       AGE
redis-node-0   2/2     Running   0              72d
redis-node-1   2/2     Running   0              72d
redis-node-2   2/2     Running   0              72d

# 10.90.11.96 - LoadBalancer IP of the Redis installation
kubectl -n redis get svc
NAME             TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                          AGE
redis            LoadBalancer   10.96.135.84    10.90.11.96   6379:32467/TCP,26379:32413/TCP   86d
redis-headless   ClusterIP      None            <none>        6379/TCP,26379/TCP               86d


# Trying to connect to this Redis via LoadBalancer IP
redis-cli -h 10.90.11.96 -p 26379 -a '<password>' 2>/dev/null
10.90.11.96:26379> SENTINEL GET-MASTER-ADDR-BY-NAME redis
1) "redis-node-2.redis-headless.redis.svc.cluster.local"
2) "6379"

In example above we successfully got Redis master's address, but it is internal K8s FQDN and we cannot use it from outside of K8s.

What is the feature you are proposing to solve the problem?

It would be nice to have an ability to discover Redis master from outside of K8s cluster.

Only one idea:

  1. Add K8s Service resource that should select only master Pod. This Service resource should contain individual selector e.g. master: true
  2. Implement simple app that will continuously check Redis master Pod and mark it with label master: true

This approach already used in combor / k8s-mongo-labeler-sidecar

What alternatives have you considered?

No response

@github-actions github-actions bot added the triage Triage is needed label Apr 19, 2024
@iamalryz iamalryz changed the title External access to cluster in Master-Replicas with Sentinel topology [bitnami/redis] External access to cluster in Master-Replicas with Sentinel topology Apr 19, 2024
@shlomitubul
Copy link
Contributor

shlomitubul commented Apr 20, 2024

@iamalryz can you please share the values.yaml? I also have redis+setinel setup & I successfully use master with lb using: createMaster: true, did you try it?

@iamalryz
Copy link
Author

@shlomitubul thaks! I used older version of Redis Helm chart where there is no sentinel.service.createMaster parameter. I just tried newest chart version and it works fine.

I'll close this issue.

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

No branches or pull requests

3 participants