Skip to content

🐳 (docker): add redis-sentinel#1255

Draft
douglasduteil wants to merge 3 commits into
mainfrom
douglasduteil/add-redis-sentinel-POC
Draft

🐳 (docker): add redis-sentinel#1255
douglasduteil wants to merge 3 commits into
mainfrom
douglasduteil/add-redis-sentinel-POC

Conversation

@douglasduteil

@douglasduteil douglasduteil commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
image

Problem

Local dev has only a plain redis-pwd (port 6379). Production runs a
1+1+3 sentinel cluster for HA, but there is no way to exercise the ioredis
sentinel code path locally.

Proposal

dks switch redis-sentinel β€” local replica of the production HA topology
so the ioredis sentinel code path can be exercised
without deploying to k8s.

Redis Sentinel is Redis's built-in HA mechanism.
Sentinels are independent processes that monitor a master/replica pair
and coordinate a failover β€” promoting the replica to master β€” when the
master becomes unreachable. A quorum (the minimum number of sentinels
that must agree the master is down before acting) prevents false
failovers from transient network issues. At least 3 sentinels are
required so quorum (N/2+1 = 2) can still be reached if one sentinel is
lost. See understanding sentinels.

  • redis-sentinel-master / redis-sentinel-replica β€”
    replication pair; the replica is the standby that
    sentinels can promote on failover.
  • redis-sentinel-1/2/3 β€” three sentinel processes monitoring mymaster,
    quorum 2; mirrors the 1+1+3 topology running in production.
  • redis-sentinel stack β€” aggregator that starts the full cluster in one
    command; waits for all nodes to be healthy before the stack is
    considered up.
  • core-sentinel β€” core variant whose env points at the sentinel cluster
    (Redis_SENTINELS, Redis_NAME) instead of the standalone redis-pwd;
    keeps hostname: core so nginx routes transparently without a new vhost.

@douglasduteil douglasduteil self-assigned this Jun 16, 2026
@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch 2 times, most recently from a19f8ae to d3ca164 Compare June 16, 2026 16:35
@douglasduteil douglasduteil changed the title ✨ add redis-sentinel POC ✨ add redis-sentinel Jun 17, 2026
@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch 3 times, most recently from 65df3ca to 76bd7c1 Compare June 17, 2026 09:40
@douglasduteil douglasduteil marked this pull request as ready for review June 17, 2026 09:58
@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch 2 times, most recently from 3dad7c6 to 6e202c1 Compare June 17, 2026 11:15
@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch from 6e202c1 to f0e3e24 Compare June 17, 2026 11:44
@jonathanperret

Copy link
Copy Markdown
Contributor

J'ai la mΓͺme remarque et proposition que lΓ  : #1263 (comment)

@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch 3 times, most recently from 017678f to 2b59256 Compare June 17, 2026 17:19
**Problem**

`redis.ts` reads direct-connect env vars (`HOST`, `PORT`, `PASSWORD`,
`DB`, `TLS`) but not the sentinel ones. The `RedisConfig` DTO already
declares the sentinel fields (`sentinels`, `name`,
`sentinelPassword`) β€” they just had no env-var source.

**Proposal**

Read `Redis_SENTINELS`, `Redis_NAME`, `Redis_SENTINEL_PASSWORD`. When
`Redis_SENTINELS` is non-empty, populate the sentinel fields and
leave `host`/`port` undefined; otherwise keep the direct-connect
fields. Document the new env vars.
@douglasduteil douglasduteil changed the base branch from main to douglasduteil/add-redis-sentinel-config June 17, 2026 18:21
@douglasduteil douglasduteil marked this pull request as draft June 17, 2026 18:21
**Problem**

Local dev has only a plain `redis-pwd` (port 6379). Production runs a
1+1+3 sentinel cluster for HA, but there is no way to exercise the ioredis
sentinel code path locally.

**Proposal**

`dks switch redis-sentinel` β€” local replica of the production HA topology
so the ioredis [sentinel code path][ioredis-sentinel] can be exercised
without deploying to k8s.

[Redis Sentinel][redis-sentinel] is Redis's built-in HA mechanism.
Sentinels are independent processes that monitor a master/replica pair
and coordinate a failover β€” promoting the replica to master β€” when the
master becomes unreachable. A quorum (the minimum number of sentinels
that must agree the master is down before acting) prevents false
failovers from transient network issues. At least 3 sentinels are
required so quorum (N/2+1 = 2) can still be reached if one sentinel is
lost. See [understanding sentinels][sentinel-tutorial].

- `redis-sentinel-master` / `redis-sentinel-replica` β€”
  [replication][redis-replication] pair; the replica is the standby that
  sentinels can promote on failover.
- `redis-sentinel-1/2/3` β€” three sentinel processes monitoring `mymaster`,
  quorum 2; mirrors the 1+1+3 topology running in production.
- `redis-sentinel` stack β€” aggregator that starts the full cluster in one
  command; waits for all nodes to be healthy before the stack is
  considered up.
- `core-sentinel` β€” `core` variant whose env points at the sentinel cluster
  (`Redis_SENTINELS`, `Redis_NAME`) instead of the standalone `redis-pwd`;
  keeps `hostname: core` so nginx routes transparently without a new vhost.

[ioredis-sentinel]: https://github.com/redis/ioredis#sentinel
[redis-sentinel]: https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/
[sentinel-tutorial]: https://redis.io/tutorials/operate/redis-at-scale/high-availability/understanding-sentinels/
[redis-replication]: https://redis.io/docs/latest/operate/oss_and_stack/management/replication/
WIP β€” remove before merge.

Adds a third matrix entry to `test_e2e` so reviewers can see the
sentinel code path exercised in CI alongside the regular `medium` run.
@douglasduteil douglasduteil force-pushed the douglasduteil/add-redis-sentinel-POC branch from 2b59256 to b60c9d1 Compare June 17, 2026 18:21
@douglasduteil douglasduteil changed the title ✨ add redis-sentinel 🐳 (docker): add redis-sentinel Jun 17, 2026
Base automatically changed from douglasduteil/add-redis-sentinel-config to main June 18, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants