ikatlinsky commented on issue #10596: URL: https://github.com/apache/apisix/issues/10596#issuecomment-1844685990
> So the redis cluster could be formed with one node only? @ikatlinsky Nope, let me try to explain. We have the following setup: 1. Redis Cluster deployed in Kubernetes with 3 nodes (for example, 10.42.0.113:6379;10.42.0.114:6379;10.42.0.115:6379) 2. Redis Cluster nodes are accessible through [Kubernetes Headless Service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) (for example redis-headless-service) Kubernetes headless service is a Kubernetes service that does not assign an IP address to itself. Instead, it returns the IP addresses of the pods associated with it directly to the DNS system, allowing clients to connect to individual pods directly. So, each time we request redis-headless service we get all 3 nodes ips back (not a single IP of a single node), and it is the task of Redis client to route to one of the nodes properly. Below two configurations are equivalent in the results. With headless service: ``` curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "uri": "/index.html", "plugins": { "limit-count": { "redis_cluster_nodes": [ "redis-headless-service:6379" ], } }, "upstream": {} }' ``` With each node provided separately: ``` curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "uri": "/index.html", "plugins": { "limit-count": { "redis_cluster_nodes": [ "10.42.0.113:6379", "10.42.0.114:6379", "10.42.0.115:6379" ], } }, "upstream": {} }' ``` Hope that explains better the use case, @monkeyDluffy6017 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
