Overview
TheRedisCluster custom resource defines a Redis replication cluster with one primary and N-1 replicas. It supports standalone and sentinel modes.
API Group: redis.io/v1Kind:
RedisClusterShort Name:
rc
Spec Fields
Core Configuration
Total number of Redis pods (1 primary + N-1 replicas)Constraints:
- Minimum:
1 - Default:
1
Redis operating modeEnum values:
standalone- Single primary with optional replicassentinel- Sentinel-managed automatic failovercluster- Reserved for future use (currently rejected by webhook)
Controls how the primary is updated during rolling updatesEnum values:
unsupervised- Primary replacement runs automatically after replicas are updatedsupervised- Waits for operator approval viaredis.io/approve-primary-updateannotation
Redis container image (wire-compatible with Valkey 7.x/8.x)
Storage
PVC template for /data volumes
Redis Configuration
Redis.conf configuration parameters as key-value pairsExample:Note: Parameters requiring restart (
bind, port, tls-port, unixsocket, databases) are applied on pod creation but not live-reloaded.CPU/memory requests and limits for Redis containersExample:
Replication
Minimum number of synchronous replicas (corresponds to
min-replicas-to-write)Constraints:- Minimum:
0
Maximum number of synchronous replicas (corresponds to
min-replicas-max-lag)Constraints:- Minimum:
0
Secrets
Reference to a Secret containing the Redis password in key
password. If not set, the operator auto-generates one.Reference to a Secret containing ACL rules in key
aclThe instance manager writes this to /data/users.acl and issues ACL LOAD on changes.Reference to a Secret containing
tls.crt and tls.key for TLS encryptionReference to a Secret containing
ca.crt for TLS client certificate verificationReference to a Secret containing object storage credentials for backupsExpected keys:
AWS_ACCESS_KEY_IDoraws_access_key_idoraccessKeyIdoraccess_key_idAWS_SECRET_ACCESS_KEYoraws_secret_access_keyorsecretAccessKeyorsecret_access_keyAWS_SESSION_TOKENoraws_session_tokenorsessionTokenorsession_token(optional)
High Availability
Controls whether a PodDisruptionBudget is created to protect against simultaneous disruptions
Configures runtime split-brain prevention for primary pods
Scheduling
Constrains pods to nodes with matching labelsExample:
Pod affinity/anti-affinity scheduling rules. See Kubernetes Affinity docs.
Allow scheduling onto tainted nodes. See Kubernetes Tolerations docs.
Control how pods are spread across topology domains. See Kubernetes Topology Spread Constraints docs.
Bootstrap
Defines how to initialize the cluster from a backup
Maintenance
Controls planned node maintenance behavior
Disaster Recovery (Replica Mode)
Configures external replication topology for disaster recovery clusters
Status Fields
Human-readable cluster phasePossible values:
Creating- Initial provisioning in progressHealthy- All instances ready and replication healthyDegraded- Some instances not ready or replication lag detectedReplicating- External replication active (replica mode)FailingOver- Automatic failover in progressScaling- Scale-up or scale-down in progressUpdating- Rolling update in progressWaitingForUser- Supervised primary update waiting for approvalDeleting- Finalizers executingHibernating- All pods scaled to zero (annotation-triggered)
Pod name of the current primary instanceExample:
my-redis-0Count of data pods passing readiness probes
Count of sentinel pods passing readiness probes (sentinel mode only)
Total number of managed pods
Per-pod status map keyed by pod name
Count of healthy PersistentVolumeClaims
List of PVC names not attached to any podUsed to detect orphaned storage after scale-down or pod deletion.
Maps secret names to their ResourceVersionUsed to detect secret rotation and trigger reconciliation.
Latest available observations of the cluster stateStandard condition types:
Ready- Overall cluster healthPrimaryAvailable- Primary instance is reachableReplicationHealthy- All replicas have healthy replication linksReplicaMode- External replication activePrimaryUpdateWaiting- Supervised update waiting for approvalLastBackupSucceeded- Most recent backup completed successfullyHibernated- Cluster is hibernatedMaintenanceInProgress- Node maintenance window activePVCResizeInProgress- PVC resize operation in progress
Annotations
Fencing
Key:redis.io/fencedInstances
Value: JSON array of pod names to fence (stop redis-server)
Example:
Hibernation
Key:redis.io/hibernation
Value: on or true
Example:
Primary Update Approval
Key:redis.io/approve-primary-update
Value: true
Example:
Labels
The operator applies these labels to all managed resources:| Label | Values | Description |
|---|---|---|
redis.io/cluster | <cluster-name> | RedisCluster name |
redis.io/instance | <pod-name> | Pod name |
redis.io/role | primary, replica, sentinel | Current role |
redis.io/workload | data, sentinel | Workload type |