FAQ — Redis
How does Redis Sentinel work on Hikube?
Redis on Hikube is deployed via the Spotahome Redis Operator, which sets up a Redis Sentinel architecture for high availability:
- Redis Sentinel monitors Redis instances and performs automatic failover when the primary fails.
- A quorum is required to decide on failover: you need at least 3 replicas to guarantee a working quorum (majority of 2 out of 3).
- Clients should connect via the Sentinel service to benefit from automatic failover.
spec:
replicas: 3 # Minimum recommended for Sentinel quorum
In production, always use at least 3 replicas to ensure proper Sentinel quorum operation.
What is the difference between resourcesPreset and resources?
The resourcesPreset field lets you choose a predetermined resource profile for each Redis replica. If the resources field (explicit CPU/memory) is defined, resourcesPreset is completely ignored.
| Preset | CPU | Memory |
|---|---|---|
nano | 250m | 128Mi |
micro | 500m | 256Mi |
small | 1 | 512Mi |
medium | 1 | 1Gi |
large | 2 | 2Gi |
xlarge | 4 | 4Gi |
2xlarge | 8 | 8Gi |
spec:
# Using a preset
resourcesPreset: small
# OR explicit configuration (the preset is then ignored)
resources:
cpu: 1000m
memory: 1Gi
Does Redis persist data?
Yes. Redis on Hikube uses RDB/AOF persistence combined with persistent volumes (PVC). Data is written to disk and survives pod restarts.
The storageClass choice affects durability:
local: data persisted on the physical node. Fast but vulnerable to node failure. Recommended ifreplicas> 1 (Redis Sentinel replication already ensures HA).replicated: data replicated across multiple nodes. Slower but resilient to failures. Recommended ifreplicas= 1 (replicated storage compensates for the lack of application replication).
spec:
size: 2Gi
storageClass: local # If replicas > 1 (Sentinel ensures HA)
What is the authEnabled parameter for?
When authEnabled is set to true (default value), a password is automatically generated and stored in a Kubernetes Secret. This password is required for any connection to Redis.
spec:
authEnabled: true # Default value
Always enable authEnabled: true in production. Disabling authentication exposes your data to any pod that can access the Redis service.
How to scale Redis?
To increase the number of Redis replicas, modify the replicas field in your manifest and apply the change:
spec:
replicas: 5 # Increase the number of replicas
kubectl apply -f redis.yaml
Redis Sentinel automatically reconfigures the cluster to integrate the new replicas. No manual intervention is required.
How to connect to Redis from a pod?
-
Get the password from the Secret (if
authEnabled: true):kubectl get tenantsecret redis-<name>-auth -o jsonpath='{.data.password}' | base64 -d -
Connect via the Sentinel service (recommended for automatic failover):
# Sentinel service
redis-cli -h rfs-redis-<name> -p 26379 SENTINEL get-master-addr-by-name mymaster -
Or connect directly to the Redis service:
# Direct service
redis-cli -h rfr-redis-<name> -p 6379 -a <password>
Prefer connecting via the Sentinel service (rfs-redis-<name>) so your applications automatically follow the primary during failover.