Repository navigation
feat(charts): CCP-6557 - run Redis under Sentinel in DEV and PR envs (+ PR-env values fix, exporter pin) - #354
Conversation
The backend already supports Sentinel. buildRedisOptions() in
backend/src/queue/redis-connection.ts switches to sentinels + masterName when
REDIS_SENTINELS is set, and nothing bypasses it: createQueue, createWorker,
createQueueEvents and createRedisClient all route through it, and the three
direct `new Redis(...)` sites pass its output. charts/app's backend deployment
already emits REDIS_SENTINELS, REDIS_MASTER_NAME and REDIS_SENTINEL_PASSWORD
behind `if global.config.redisSentinels`. The only reason none of it was live
is that nothing ever set that value.
So this is a values change, not an app change.
DEV and the PR envs share the one Redis release, and both deploy from
charts/app/values.yaml (the chart's own defaults, which .deployer.yml uses when
no values file is passed), so redisSentinels is set there. TEST and PROD set it
to "" in their own files to stay on the direct connection until their cutover.
Also sets sentinel.quorum back to 2. This file had overridden the chart default
to 1, which lets a single Sentinel declare a failover on its own.
Rendered topology, per environment:
dev StatefulSet common-notify-redis-node replicas=3
Service common-notify-redis 6379, 26379
test StatefulSet common-notify-redis-master replicas=1
StatefulSet common-notify-redis-replicas replicas=2
prod (same as test)
NOT A DROP-IN FOR TEST/PROD. Sentinel mode replaces the master/replicas
StatefulSets with a single redis-node StatefulSet on new PVCs, and removes the
-redis-master Service. The AOF does not carry over, and this Redis backs a
durable Bull queue (maxmemory-policy noeviction), so cutting over test or prod
means draining the queues in a window first. DEV losing its queue is
acceptable, which is why it goes first.
Verified: both specs pass (35 tests); app chart renders REDIS_SENTINELS only
for the dev/PR profile; REDIS_SENTINEL_PASSWORD reads the same redis-password
key that REDIS_PASSWORD already requires, and that key exists in the dev secret.
Merge-order constraint found after opening thisPR environments share DEV's single Redis release. Three backends in
So on merge:
Neither blocks this PR, but whoever merges it should expect to poke #284 afterwards. Worth a line in the release notes too, since the same thing will happen to any PR env open at the time. |
Failover tested and workingThe PR said no failover had been observed. It has now. I deployed an isolated throwaway release ( Healthy state — all three Sentinels agreed, with the Failover — deleted the master pod ( Both surviving Sentinels agreed on
Correcting something I noted earlierI flagged that That matters here because a node drain is a graceful eviction, which is precisely the scenario in this ticket. So the drain case is seconds, and the 60s ceiling only applies to a hard node failure. Still arguably worth lowering to 5–10s for that case, but it is not the blocker I suggested. CaveatThis proves the Sentinel topology and promotion work on this cluster, with this chart version and image, under OpenShift's SCC. It does not exercise the Notify backend against it —
Trial release deleted; nothing left behind in dev. |
…inel change The rationale lives in the PR description instead. Two pre-existing comments were deleted rather than restored, because this change makes them false: values-dev.yml said Sentinel was disabled "not needed with only 1 replica", and the sentinel block in values.yml said enabling it would break the app and to keep it off. No change to rendered output - dev/PR still get REDIS_SENTINELS, test and prod still render none.
The exporter ran on :latest while the Redis image itself is digest-pinned. The tag had already drifted within a single release - redis-master-0 and redis-replicas-1 on sha256:81a82596, redis-replicas-0 on sha256:8a6962be. Pinned to the digest the master runs. Only the metrics sidecar is affected, so the worst case is a stalled scrape rather than a Redis outage. Folded in here rather than raised as its own PR, to keep the review queue short.
… ones
The Redis release name is ${repo}-redis for every caller, so a PR that
touches charts/redis/ upgrades the one shared DEV release. PRs pass no
environment, so that upgrade was falling through to the base values.yml -
the TEST profile - and overwriting DEV's own overrides.
Invert the branch: PROD and TEST are named explicitly, everything else
(DEV and PRs, which share the namespace and the release) takes
values-dev.yml.
Today this silently scales DEV's Redis from 1 replica to 2, against the
storage-quota reason values-dev.yml gives for pinning it at 1. It gets
worse with two PRs in flight: #353 adds a master PDB to the base values
that DEV deliberately disables, and #354 enables Sentinel for DEV only,
which a PR deploy would then fail to enable while the app expects it.
sentinel.image set only registry, so it inherited the chart default bitnami/redis-sentinel:latest - the last floating tag in the release. That tag was rebuilt on 2026-11-29, which is the same drift that put three pods in one release on two different exporter builds. Pinned to the digest whose APP_VERSION is 8.10.3, matching the Redis image pin, so Sentinel and Redis cannot diverge in version. Verified with helm template against bitnami/redis 25.4.1: DEV, TEST and PROD now render every image by digest and no floating tags remain.
|
* fix(charts): CCP-5828 - stop the Redis master PDB permitting its own eviction The bitnami chart leaves master.pdb.minAvailable and maxUnavailable empty, which renders maxUnavailable: 1. Against a single-pod master StatefulSet that allows one voluntary disruption, so the PDB permits exactly the eviction it exists to prevent. Verified in PROD: common-notify-redis-master maxUnavailable=1 allowed-disruptions=1 A node drain, cluster upgrade or rebalance can therefore evict the only Redis master. Nothing promotes a replica (Sentinel has never run, CCP-6557) and the backend is pinned to REDIS_HOST=common-notify-redis-master, so the Bull queues stop until the master is rescheduled. minAvailable: 1 takes allowed-disruptions to 0, so the drain blocks instead. TRADE-OFF: this does not add failover, it changes the failure mode. A drain of the master's node will now stall rather than cause a silent prod outage. That is the safer of the two until Sentinel lands, because a blocked drain is visible and asks a question, where an evicted master just stops the queues. It does mean the platform team may hit a stuck drain, so CCP-6557 should not sit indefinitely behind this. Replica PDB deliberately unchanged: maxUnavailable: 1 across 2 replicas still leaves one serving. Rendered against charts/redis/values.yml with the upstream chart at the version PROD runs (redis-25.4.1): master PDB becomes minAvailable: 1 with the same selector as the live object, replica PDB unchanged, all 15 resources render. * fix(charts): CCP-5828 - repair the dead PDB override in dev values-dev.yml set master.podDisruptionBudget.enabled and replica.podDisruptionBudget.enabled. Upstream renamed those to pdb.create, so both keys were inert and dev has carried PDBs for 101 days despite the comment saying they were disabled: f6bc3f-dev common-notify-redis-master maxUnavailable=1 (101d) f6bc3f-dev common-notify-redis-replicas maxUnavailable=1 (101d) Switched to pdb.create: false, which honours the original intent and keeps minAvailable: 1 out of dev. Dev nodes are drained routinely and a blocked drain there costs more than a Redis restart does. values.yml is the shared base and TEST gets no override file at all (.deployer.yml only passes one for DEV and PROD), so the base change lands in TEST and PROD. Rendered per environment: dev 0 PDBs test master minAvailable: 1, replica maxUnavailable: 1 prod master minAvailable: 1, replica maxUnavailable: 1 * feat(charts): CCP-6557 - run Redis under Sentinel in DEV and PR envs (+ PR-env values fix, exporter pin) (#354) * feat(charts): CCP-6557 - run Redis under Sentinel in DEV and PR envs The backend already supports Sentinel. buildRedisOptions() in backend/src/queue/redis-connection.ts switches to sentinels + masterName when REDIS_SENTINELS is set, and nothing bypasses it: createQueue, createWorker, createQueueEvents and createRedisClient all route through it, and the three direct `new Redis(...)` sites pass its output. charts/app's backend deployment already emits REDIS_SENTINELS, REDIS_MASTER_NAME and REDIS_SENTINEL_PASSWORD behind `if global.config.redisSentinels`. The only reason none of it was live is that nothing ever set that value. So this is a values change, not an app change. DEV and the PR envs share the one Redis release, and both deploy from charts/app/values.yaml (the chart's own defaults, which .deployer.yml uses when no values file is passed), so redisSentinels is set there. TEST and PROD set it to "" in their own files to stay on the direct connection until their cutover. Also sets sentinel.quorum back to 2. This file had overridden the chart default to 1, which lets a single Sentinel declare a failover on its own. Rendered topology, per environment: dev StatefulSet common-notify-redis-node replicas=3 Service common-notify-redis 6379, 26379 test StatefulSet common-notify-redis-master replicas=1 StatefulSet common-notify-redis-replicas replicas=2 prod (same as test) NOT A DROP-IN FOR TEST/PROD. Sentinel mode replaces the master/replicas StatefulSets with a single redis-node StatefulSet on new PVCs, and removes the -redis-master Service. The AOF does not carry over, and this Redis backs a durable Bull queue (maxmemory-policy noeviction), so cutting over test or prod means draining the queues in a window first. DEV losing its queue is acceptable, which is why it goes first. Verified: both specs pass (35 tests); app chart renders REDIS_SENTINELS only for the dev/PR profile; REDIS_SENTINEL_PASSWORD reads the same redis-password key that REDIS_PASSWORD already requires, and that key exists in the dev secret. * refactor(charts): CCP-6557 - drop the inline commentary from the Sentinel change The rationale lives in the PR description instead. Two pre-existing comments were deleted rather than restored, because this change makes them false: values-dev.yml said Sentinel was disabled "not needed with only 1 replica", and the sentinel block in values.yml said enabling it would break the app and to keep it off. No change to rendered output - dev/PR still get REDIS_SENTINELS, test and prod still render none. * fix(charts): CCP-6557 - pin the redis-exporter image by digest The exporter ran on :latest while the Redis image itself is digest-pinned. The tag had already drifted within a single release - redis-master-0 and redis-replicas-1 on sha256:81a82596, redis-replicas-0 on sha256:8a6962be. Pinned to the digest the master runs. Only the metrics sidecar is affected, so the worst case is a stalled scrape rather than a Redis outage. Folded in here rather than raised as its own PR, to keep the review queue short. * fix(ci): CCP-6557 - deploy PR Redis with the DEV values, not the base ones The Redis release name is ${repo}-redis for every caller, so a PR that touches charts/redis/ upgrades the one shared DEV release. PRs pass no environment, so that upgrade was falling through to the base values.yml - the TEST profile - and overwriting DEV's own overrides. Invert the branch: PROD and TEST are named explicitly, everything else (DEV and PRs, which share the namespace and the release) takes values-dev.yml. Today this silently scales DEV's Redis from 1 replica to 2, against the storage-quota reason values-dev.yml gives for pinning it at 1. It gets worse with two PRs in flight: #353 adds a master PDB to the base values that DEV deliberately disables, and #354 enables Sentinel for DEV only, which a PR deploy would then fail to enable while the app expects it. * fix(charts): CCP-6557 - pin the sentinel image by digest sentinel.image set only registry, so it inherited the chart default bitnami/redis-sentinel:latest - the last floating tag in the release. That tag was rebuilt on 2026-11-29, which is the same drift that put three pods in one release on two different exporter builds. Pinned to the digest whose APP_VERSION is 8.10.3, matching the Redis image pin, so Sentinel and Redis cannot diverge in version. Verified with helm template against bitnami/redis 25.4.1: DEV, TEST and PROD now render every image by digest and no floating tags remain.



Stacked on #353 — base will retarget to
mainonce that merges. Review that one first.Also folded in here (was #356, plus one small fix)
Kept in this PR rather than opened separately, to keep the review queue short.
1. PR environments deployed Redis with the base values, not DEV's (was #356).
RELEASE_NAMEis${repo}-redisfor every caller - no PR number - so a PR touchingcharts/redis/upgrades the one shared DEV release. Butpr-open.ymlpasses noenvironment(the input is documented "omit for PRs"), so it fell through to the base values, i.e. the TEST profile.This matters directly for this PR: a PR env would leave
sentinel.enabled: falsewhile the app chart's DEV/PR profile points atcommon-notify-redis:26379, so PR envs could never exercise Sentinel at all. It also already scales DEV from 1 replica to 2 today, against the 40Gi quota reasonvalues-dev.ymlgives for pinning it at 1 - and once #353 merges, it hands DEV a PDB that DEV deliberately disables.PROD and TEST are now named explicitly; everything else (DEV and PRs, which share namespace and release) takes
values-dev.yml. Only the PR case changes; verified under bash for all four inputs.2. The redis-exporter image was on
:latestwhile the Redis image itself is digest-pinned.The tag had already drifted inside a single release:
Pinned to the digest the master runs. Only the metrics sidecar is affected, so the worst case is a stalled scrape, not a Redis outage.
Deliberately NOT folded in
volumeClaimTemplatesare immutable, so changing it means recreating the StatefulSet - not a small change, and it needs its own window.from, so any pod in any namespace can reach 6379 (CCP-5696). Getting thefromselectors wrong breaks every client, so it deserves its own review rather than riding along here.The app work was already done
This ticket was sized partly for "rewire ioredis and BullMQ through Sentinel". That already exists:
buildRedisOptions()(redis-connection.ts:29) switches tosentinels+name+sentinelPasswordwheneverREDIS_SENTINELSis set, and falls back to host/port otherwise.createQueue,createWorker,createQueueEventsandcreateRedisClientall call it, and the three directnew Redis(...)sites (webhook-trigger.service.ts,notification-pubsub.service.ts×2) pass its output.charts/appalready emitsREDIS_SENTINELS,REDIS_MASTER_NAMEandREDIS_SENTINEL_PASSWORDbehindif .Values.global.config.redisSentinels.The only reason none of it was live: nothing ever set
redisSentinels. So this PR is a values change.What changes
DEV and every PR env share one Redis release, and both deploy from
charts/app/values.yaml— the chart's own defaults, which.deployer.ymluses when no values file is passed. SoredisSentinelsgoes there, andvalues-test.yaml/values-prod.yamlset it to""to stay on the direct connection.sentinel.quorumgoes back to 2. This file had overridden the chart default to 1, which lets a single Sentinel declare a failover alone.Rendered topology
common-notify-redis-node(3)common-notify-redis— 6379, 26379redis-master(1),redis-replicas(2)redis-master— 6379redis-master(1),redis-replicas(2)redis-master— 6379And the backend env, rendered per values file:
This is not a drop-in for test or prod
Enabling Sentinel replaces the master/replicas StatefulSets with a single
redis-nodeStatefulSet on new PVCs (redis-data+sentinel-data), and removes the-redis-masterService.So the AOF does not carry over. This Redis backs a durable Bull queue —
maxmemory-policy noeviction, andvalues.ymlsays outright it is "NOT a disposable cache". Cutting over test or prod therefore means draining the queues in a window first, not just flipping a value. DEV losing its queue is acceptable, which is why DEV goes first and why test and prod are explicitly pinned here rather than left to inherit.The old replica PVCs also carry
whenDeleted: Delete, so they go with the old StatefulSet.Verification
vitest run src/config/configuration.spec.ts src/queue/redis-connection.spec.ts→ 35 passedredis-25.4.1(the version PROD runs); results are the table above, parsed from the YAML rather than greppedREDIS_SENTINELSappears only in the dev/PR profileREDIS_SENTINEL_PASSWORDreads the sameredis-passwordkeyREDIS_PASSWORDalready requires, and that key exists incommon-notify-redisin dev — so no new secret dependency and noCreateContainerConfigErrorrisksentinel.masterSetdefault ismymaster, matching the backend'sREDIS_MASTER_NAMEdefaultWhat this does not prove
Failover has since been observed on an isolated throwaway release - see the comment below (master deleted, replica promoted in 3s). What is still unproven is the backend connecting through Sentinel: that needs this on DEV.
Three things to watch on the DEV deploy: all 3
redis-nodepods reach 2/2 and Sentinel agrees on a master; the backend connects without AUTH errors in the logs; and the queues drain. Then cordon the master's node and confirm a replica is promoted and the API keeps accepting notifications.Advances CCP-6557 for DEV. Does not close it — test and prod cutover and the drain test remain.
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: