distribution icon indicating copy to clipboard operation
distribution copied to clipboard

registry v3 documentation does not mention MasterName option for Redis that is required for Sentinel to work

Open afunix opened this issue 9 months ago • 1 comments

Description

UniversalOptions of go-redis mention MasterName option ( https://pkg.go.dev/github.com/redis/go-redis/v9#UniversalOptions ) which is used to enable Redis Sentinel.

Redis configuration options section ( https://github.com/distribution/distribution/blob/main/docs/content/about/configuration.md#redis ) does not mention this option, so there is no way for a regular user to find out how to enable Sentinel.

Reproduce

  1. start registry version 3.0.0 with REGISTRY_REDIS_OPTIONS_ADDRS configured to multiple hostnames of Redis Sentinel cluster
  2. Registry reports only using redis as cache, nothing appears in Redis database:
time="2025-05-19T22:11:56.305491792Z" level=info msg="using redis blob descriptor cache" environment=development go.version=go1.23.7 instance.id=5555f949-d40b-44ad-b828-35134aadd751 service=registry version=3.0.0

Expected behavior

Registry is able to discover Redis Sentinel nodes, eg:

redis: 2025/05/19 22:12:04 sentinel.go:762: sentinel: discovered new sentinel="XXXX:26379" for master="YYYY"
redis: 2025/05/19 22:12:04 sentinel.go:762: sentinel: discovered new sentinel="XXXX:26379" for master="YYYY"
redis: 2025/05/19 22:12:04 sentinel.go:762: sentinel: discovered new sentinel="XXXX:26379" for master="YYYY"
redis: 2025/05/19 22:12:04 sentinel.go:762: sentinel: discovered new sentinel="XXXX:26379" for master="YYYY"
redis: 2025/05/19 22:12:04 sentinel.go:762: sentinel: discovered new sentinel="XXXX:26379" for master="YYYY"

Keys starts to appear in Redis DB.

registry version

3.0.0

Additional Info

setting REGISTRY_REDIS_OPTIONS_MASTERNAME to a correct name enables Sentinel in go-redis

afunix avatar May 19 '25 22:05 afunix

Feel free to open a PR for docs update.

milosgajdos avatar May 21 '25 14:05 milosgajdos