Access Methods

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.

TOC

How to Obtain Access Addresses

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 Addresses

Internal cluster access provides connectivity within the Kubernetes network environment. Two connection options are available:

  1. DNS-based Internal Routing: Uses Kubernetes service discovery mechanisms
  2. IP-based Internal Routing: Uses direct IP addressing

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 Addresses

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:

  • NodePort: Exposes Redis on static ports on each Kubernetes node
  • LoadBalancer: Provisions an external load balancer to route traffic to Redis instances

To obtain external access addresses: Navigate to Instance Details > Access Method > Access from outside the Cluster

NodePort Access Considerations

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.

Connection Methods

The following sections outline how to establish connections to Redis instances based on their architecture.

Sentinel Mode

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)

Cluster 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)