redis-applier
Custom Go consumer that reads redis-writes from local Kafka and applies into local Redis.
Quick facts
What it is
End-to-end DR test passed 2026-05-05: a write to DC Redis appeared in DR Redis after the MM2 hop and a redis-applier re-apply on the DR side, validating ADR-0018.
Architecture
DC DR
── ──
App ──produce──▶ Kafka(redis-writes) Kafka(redis-writes, mirrored)
│ │
│ consumer-group │ consumer-group
│ "redis-applier" │ "redis-applier"
▼ ▼
redis-applier (3 pods) redis-applier (3 pods)
│ partition-affined │
▼ ▼
Redis (RedisFailover) Redis (RedisFailover)
3-pod Deployment per cluster running the custom Go binary at nexus.apps.sub.comptech-lab.com/redis-applier:0.1.1 (distroless, ~16.9 MB). Each pod joins the redis-applier consumer group on the local Kafka broker; partitions are auto-balanced across the 3 pods. Each consumed message is decoded and applied to the local Sentinel-fronted Redis primary.
Cross-cluster durability is automatic: DC writes hit DC Kafka, MirrorMaker 2 mirrors them to DR Kafka, DR's redis-applier consumes and applies to DR Redis. Apps NEVER write directly to Redis — that bypasses the WAL.
Configuration
Source: clusters/<cluster>/manifests/redis/applier/ — Deployment + Service + KafkaUser (SCRAM-SHA-512 against the internal scram listener on port 9095). Auth secret is derived from the KafkaUser CR's generated Secret.
Image: nexus.apps.sub.comptech-lab.com/redis-applier:0.1.1. Build path: scripts/redis/redis-applier in the lab repo (Go 1.22+, podman build, ctr import on rke2 nodes; pushed to in-cluster Nexus).
v0.1.1 fix: kgo.OnPartitionsAssigned hook flips /readyz as soon as the consumer joins the group — v0.1.0 only flipped after the first consumed message, which made fresh deployments look perpetually NotReady.
Operations
- Pod state:
kubectl -n redis get deploy redis-applier - Consumer-group state:
kubectl -n kafka exec kafka-broker-0 -- bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group redis-applier - Lag: same command — LAG column. Steady state should be near 0.
- Logs:
kubectl -n redis logs -l app=redis-applier --tail=100 -f - Image rebuild: see
scripts/redis/redis-applier/README.mdin the lab repo.
Failover
End-to-end test PASSED 2026-05-05 11:21: a write produced to DC Kafka redis-writes appeared in DR Redis within seconds — Kafka MM2 lag + applier batch interval. ADR-0018's pattern validated.
If DC's redis-applier is down, DR Kafka still mirrors fine; DR's applier writes the latest state to DR Redis. When DC's applier returns, it catches up from its consumer-group offset.
References
- Redis — the destination data plane
- Kafka + MirrorMaker 2 — the WAL carrier
- Nexus — image registry
- ADR-0018 (Redis via Kafka WAL) — full design rationale