A Redis Sentinel is a high-availability system designed to help manage Redis instances when not using Redis Cluster. The topology architecture consists of Redis instances with Redis Sentinel mode activated in the configuration option. A group of Redis Sentinel instances work together to achieve automatic failover for master and replica instances. Redis Sentinal acts as a source of authority for clients, allowing your Airlock Microgateway to address the current master.
- Redis Sentinel performs three tasks:
- It monitors to check if your master and slave Sentinel instances are working as expected.
- It notifies other programs or the administrator via an API when something is wrong with the monitored instances.
- It manages automatic failover on master failure. In this case, Redis Sentinal automatically promotes one of the slaves to become master, then makes the other additional slaves use the new master.
After installing the Redis Helm chart with architecture=replication
and sentinel.enabled=true
, you need to configure the CR RedisProvider. The following example assumes that redis
is the name of the Helm chart release and the Namespace. The redis-sentinel-headless
service is listening on port 26379
. The DNS records allow your Airlock Microgateway to address other Sentinel nodes if one node fails (e.g., unreachable IP).
apiVersion: microgateway.airlock.com/v1alpha1
kind: RedisProvider
metadata:
name: example-backend
spec:
mode:
sentinel:
masterName: redis-master
nodes:
- host: redis-sentinel-headless.redis.svc.cluster.local
port: 26379