{
  "id": "cluster-aware-clients",
  "title": "Enable cluster-aware clients (OSS Cluster API)",
  "url": "https://redis.io/docs/latest/operate/kubernetes/8.0/networking/cluster-aware-clients/",
  "summary": "Improve performance with cluster-aware clients by enabling the OSS Cluster API for your Redis Enterprise for Kubernetes database.",
  "content": "\nThe OSS Cluster API improves performance by allowing cluster-aware Redis clients to discover database topology and route requests directly. This feature supports cluster-aware clients running on the same Kubernetes cluster (internal) and cluster-aware clients outside the Kubernetes cluster (external).\n\n\nEnabling external access for OSS Cluster API creates a separate LoadBalancer service for each Redis Enterprise pod in addition to the LoadBalancer service for the cluster endpoint. LoadBalancers are resources that can significantly increase operational costs; plan your infrastructure budget accordingly.\n\n\n## Prerequisites\n\n- RedisEnterpriseCluster (REC) running version 8.0.10-tbd or later.\n- Proxy policy is set to `all-master-shards` or `all-nodes`.\n- Modules used by the database (if any) are bundled modules.\n- The database is not an Active-Active database.\n\n## Limitations\n\n- OSS Cluster databases with external access must be created and managed using the RedisEnterpriseDatabase (REDB) custom resource. You cannot create or configure these databases using the Redis Enterprise REST API directly.\n\n## Enable OSS Cluster API\n\nTo enable cluster-aware clients, edit the REC and REDB custom resources with the following fields.\n\n### Edit REC (RedisEnterpriseCluster) {#edit-rec}\n\n1. Edit the RedisEnterpriseCluster (REC) custom resource to add the `ossClusterSettings` section to the `spec` section.\n\nSet `externalAccessType` to `LoadBalancer` and add any `serviceAnnotations`, if required by your service provider.\n\n```yaml\nossClusterSettings:\n    externalAccessType: LoadBalancer\n    loadBalancer:\n      serviceAnnotations:\n```\n\n2. If you are using internal clients (within the Kubernetes cluster), you can specify their IP ranges in the `podCIDRs` field to improve performance. Clients from these ranges are routed directly to the Redis Enterprise pods, without going through the load balancer.\n\nThe following is an example `podCIDRs` field using example values; replace with your own unique CIDRs.\n\n```yaml\n podCIDRs:\n  - \"192.0.2.0/24\"\n  - \"198.51.100.0/24\"\n  - \"203.0.113.0/24\"\n```\n\n### Edit REDB (RedisEnterpriseDatabase) {#edit-redb}\n\n3. Edit the REDB custom resource to add the following fields and values to the `spec` section.\n\nSet `enableExternalAccess: true` to allow external clients to connect. This provisions a LoadBalancer service for each Redis Enterprise pod running a node, which increases infrastructure costs.\n\n```yaml\n  ossCluster: true\n\n  ossClusterSettings:\n    enableExternalAccess: true\n```\n\n## Connect clients\n\nUse the `kubectl get svc` command to view the services created by the OSS Cluster API. It should look similar to this example:\n\n```sh\nNAME                           TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)              AGE\nadmission                      ClusterIP      10.0.1.10        \u003cnone\u003e           443/TCP              3h28m\noss-cluster                    ClusterIP      10.0.1.20        \u003cnone\u003e           11712/TCP            3h6m\noss-cluster-headless           ClusterIP      None             \u003cnone\u003e           11712/TCP            3h6m\noss-cluster-load-balancer      LoadBalancer   10.0.1.30        203.0.113.10     11712:30245/TCP      3h6m\nrec                            ClusterIP      10.0.1.40        \u003cnone\u003e           9443/TCP,8001/TCP    3h27m\nrec-cluster                    LoadBalancer   10.0.1.50        203.0.113.20     11712:32559/TCP      3h6m\nrec-1-lb                       LoadBalancer   10.0.1.60        203.0.113.30     11712:31976/TCP      3h6m\nrec-2-lb                       LoadBalancer   10.0.1.70        203.0.113.40     11712:31972/TCP      3h6m\nrec-oss                        ClusterIP      None             \u003cnone\u003e           8070/TCP             3h27m\nrec-ui                         ClusterIP      10.0.1.80        \u003cnone\u003e           8443/TCP             3h27m\n```\n\nTo connect an external client (outside the Kubernetes cluster), use the `EXTERNAL-IP` address for the `oss-cluster-load-balancer` service.\n\nTo connect an internal client (listed in the `podCIDRs` field), use the `CLUSTER-IP` address for the `oss-cluster` service.\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-06-04T14:49:57+01:00"
}
