Connect to Failover and Replica instances
Failover and Replica architectures expose role-selecting Services. The read-write Service selects the current primary and the read-only Service selects replicas.
Failover additionally deploys or references Valkey Sentinel. Replica architecture does not deploy Sentinel; applications use the same read-write Service but must not assume Sentinel-based automatic failover.
TOC
Discover endpointsTest the write endpointTest the read-only endpointUse TLSExternal accessClient behaviorDiscover endpoints
For in-cluster clients, the stable DNS names are:
Replace the instance name and namespace for your environment. Discover the actual Service names rather than constructing them in production automation.
Test the write endpoint
Without access control list (ACL) authentication:
With a custom ACL user, request the password interactively:
Test a write only with a disposable key approved for the environment:
Test the read-only endpoint
The read-only Service can have no endpoints when no replica is ready. Replication is asynchronous, so a replica can return an older value. During primary failure and promotion, an acknowledged write can also be absent from the promoted replica. Do not use this endpoint for read-after-write consistency.
Use TLS
When spec.access.enableTLS is true, obtain a trusted client identity through
the approved certificate-distribution process. The generated server requires a
trusted client certificate by default, so the certificate authority (CA) alone
is insufficient:
rfr-valkey-failover-readwrite.default is included in the generated certificate
for this example; the .svc form is not. Inspect Certificate.spec.dnsNames
and use an exact listed name. The instance TLS Secret contains a server private
key used internally by the Operator; do not distribute that key as a general
application client identity. Do not use --insecure as a normal connection
method.
External access
For LoadBalancer, inspect the role-selecting Service and wait for an ingress
address:
For NodePort, obtain the allocated port and a reachable Kubernetes node
address. Firewall rules and routing must permit the connection:
The generated certificate does not include the LoadBalancer ingress or Kubernetes node addresses. External TLS therefore needs a product-approved certificate path whose subject alternative names cover the client hostname; the high-level 2.0.0 API does not expose an arbitrary subject-alternative-name field.
Do not publish a fixed spec.access.ports example for 2.0.0: the inspected
custom resource definition (CRD) schema and runtime parser use incompatible
formats. Leave the field unset unless
the delivered build documents a validated format.
Client behavior
- Use the read-write endpoint for writes and consistency-sensitive reads.
- Configure bounded connection, command, and retry timeouts.
- Re-resolve DNS and reconnect after a primary transition.
- Retry only operations that are safe for the application's idempotency model.
- Monitor replica health before sending production reads to the read-only endpoint.
The consistency and failover boundaries above follow the official Valkey replication and Sentinel documentation. Select a client from the Valkey client catalog and verify its retry and TLS behavior in that client's own documentation.