fix: use pod FQDN for replica-announce-ip and sentinel announce-ip#1685
Open
pcamminadi wants to merge 2 commits intoOT-CONTAINER-KIT:mainfrom
Open
fix: use pod FQDN for replica-announce-ip and sentinel announce-ip#1685pcamminadi wants to merge 2 commits intoOT-CONTAINER-KIT:mainfrom
pcamminadi wants to merge 2 commits intoOT-CONTAINER-KIT:mainfrom
Conversation
373c24a to
c4c2225
Compare
When running Redis Replication with Sentinel behind a service mesh (e.g. Istio), pod IPs can be non-routable loopback addresses. This adds resolveHostnames/announceHostnames fields to RedisReplicationSpec so that replicas and sentinels announce their FQDN instead of their pod IP. Also fixes a bug where sentinel announce-ip was incorrectly set to the master's address instead of the sentinel's own address. Signed-off-by: pcamminadi <53015959+pcamminadi@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…njection Verify that RESOLVE_HOSTNAMES and ANNOUNCE_HOSTNAMES env vars are only injected when explicitly set to "yes", and that they append correctly to existing env vars. Signed-off-by: pcamminadi <53015959+pcamminadi@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c4c2225 to
70e0d12
Compare
Open
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When running Redis Replication with Sentinel behind a service mesh (e.g. Istio), pod IPs can be non-routable loopback addresses (such as
127.0.0.6). This causes two problems:announce-ipwas set to the master's address — the existing code used theipvariable (which holds the master's address) forsentinel announce-ip, instead of the sentinel pod's own address.replica-announce-ip— in replication/standalone mode, replicas never announced their address, so sentinels tracked them by their ephemeral (and potentially non-routable) pod IP.This PR:
resolveHostnamesandannounceHostnamesfields toRedisReplicationSpec, matching the existing fields onSentinelConfig."yes", replicas setreplica-announce-ipto their pod FQDN.sentinel announce-ipinstead of incorrectly using the master's address.RESOLVE_HOSTNAMES/ANNOUNCE_HOSTNAMESenv vars to the Redis replication container.redis-replicationHelm chart.Fixes #1635
Type of change
Checklist
Additional Context
"no") preserve existing behavior — no env vars are injected unless the user explicitly sets the fields to"yes".resolveHostnames/announceHostnamesfields inSentinelConfig(common types) already existed; this PR only adds them at theRedisReplicationSpeclevel so the Redis agent can also use them.generateRedisReplicationContainerParamscovering env var injection for all combinations ofresolveHostnames/announceHostnamesvalues, including appending to existing env vars.