Skip to content

fix: pass sentinel config env vars for embedded sentinel in RedisReplication#1695

Open
peins94 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
peins94:fix/embedded-sentinel-config
Open

fix: pass sentinel config env vars for embedded sentinel in RedisReplication#1695
peins94 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
peins94:fix/embedded-sentinel-config

Conversation

@peins94
Copy link
Copy Markdown

@peins94 peins94 commented Feb 27, 2026

Description

The embedded Sentinel in RedisReplication does not pass through several SentinelConfig
fields as environment variables, unlike the standalone RedisSentinel controller. This means
downAfterMilliseconds, failoverTimeout, parallelSyncs, resolveHostnames, and
announceHostnames are all ignored for embedded Sentinel deployments despite being
defined in the CRD.
Additionally, when announceHostnames is enabled, Redis replication pods need to set
replica-announce-ip to their FQDN so that Sentinel tracks stable DNS names instead
of ephemeral pod IPs. Without this, pod restarts cause Sentinel to cache stale IPs,
leading to split-brain scenarios and failed failovers.
This PR:

  1. Passes all SentinelConfig env vars in buildSentinelEnv for embedded Sentinel
  2. Sets ANNOUNCE_HOSTNAME=yes env var on Redis containers when announceHostnames is enabled
  3. Configures replica-announce-ip to the pod FQDN in the Redis bootstrap config

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.
  • Documentation has been updated or added where necessary.

Additional Context

In production, every pod restart in a RedisReplication cluster causes Sentinel to lose
track of replicas because it caches pod IPs that change on restart. This leads to
split-brain (all pods becoming master) and hours-long full resyncs. Enabling
resolveHostnames/announceHostnames via the CRD has no effect because the embedded
Sentinel ignores these fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant