k8s_redis_sentinel_sidecar_2
Redis-Sentinel Sidecar Pattern Hands-on Guide on Kubernetes ②
Setup (create Pods)
1. Apply YAML files in order
1. Create Config
2. Create Service
3. Create StatefulSet
2. Verify Redis-Sentinel topology
1) Redis role check: ROLE
2) Check redis.conf
3) Check sentinel.conf
4) Check sentinel monitoring
Run `info sentinel` on Sentinel-0,1,2. Summary of the result:
kubectl exec -it redis-sentinel-0 -c sentinel -- redis-cli -p 28504 -a password info sentinel
5) 🖧 Redis-Sentinel node diagram
3. 💽 Load data
If you delete Redis-0 for a failover test, Kubernetes recreates it within about 2 seconds. down-after-milliseconds is 3 seconds, so Sentinel may not notice the outage. Load about 3 million keys so restart takes 5+ seconds (AOF load ~5s).
redis-benchmark generates random keys, so dbsize is a bit under 3 million.
- Actual keys: 2955238
- AOF size: aof.1.incr.aof -> 412M
- Pod memory: kubectl top pod -> 625Mi
➡ Pods are up and data is loaded. Next: failover testing.
| << K8s Sidecar Pattern Prep ① | K8s Sidecar Pattern Test ③ >> |
|---|
