Alauda Cache Service for Redis OSS provides multiple connection strategies for applications to access Redis instances. This section outlines how to obtain appropriate connection addresses and establish connections to Redis instances in both Sentinel and Cluster modes.
Redis instances support various access methods designed for different deployment scenarios. These access methods align with standard Redis connection protocols. For comprehensive details, refer to the official Redis documentation:
Internal cluster access provides connectivity within the Kubernetes network environment. Two connection options are available:
Both methods support connections to Redis instances configured in either Cluster or Sentinel mode.
To obtain internal access addresses: Navigate to Instance Details > Access Method > Access within the Cluster
External cluster access enables connectivity from outside the Kubernetes network environment, such as from applications running in different clusters or external systems. This method can also be used for intra-cluster access when permitted by network policies.
Two external access methods are supported:
To obtain external access addresses: Navigate to Instance Details > Access Method > Access from outside the Cluster
When utilizing NodePort access from external networks, verify that your network firewall allows traffic to the appropriate IP addresses and NodePort ranges. Due to architectural constraints of Redis Sentinel and Cluster protocols, direct network connectivity between client applications and NodePort endpoints is required. Proxying NodePort connections through an additional load balancer is not supported.
In multi-NIC environments, Redis Sentinel and Cluster will initialize node addresses using the default network interface of each node. Therefore, accessing Redis through non-default network interfaces combined with exposed ports is not supported. For multi-NIC deployments, the LoadBalancer access method is recommended.
The following sections outline how to establish connections to Redis instances based on their architecture.
In Sentinel mode deployments, all sentinel instances register the Redis master-replica group under the fixed name mymaster
. Client applications must use this name when connecting through the Sentinel protocol.
For detailed connection examples with popular client libraries, refer to Accessing Instances (Sentinel Mode)
In Cluster mode deployments, client applications initially connect to any node in the cluster to retrieve cluster topology information (slot distribution). During subsequent operations, clients must maintain direct connections to the appropriate Redis pods based on the key hash slot mapping.
For optimal reliability, client applications should initialize connections using the addresses of all cluster nodes.
For detailed connection examples with popular client libraries, refer to Accessing Instances (Cluster Mode)