Skip to content

feat: add sentinel-free architecture with operator-managed failover (v1.7.0)#15

Merged
usiegj00 merged 4 commits intomainfrom
feature/sentinel-free-architecture
Jan 25, 2026
Merged

feat: add sentinel-free architecture with operator-managed failover (v1.7.0)#15
usiegj00 merged 4 commits intomainfrom
feature/sentinel-free-architecture

Conversation

@usiegj00
Copy link
Copy Markdown
Collaborator

Summary

Add spec.sentinel.enabled field to allow operator-managed failover instead of Redis Sentinel, reducing pod overhead from 5 pods (2 Redis + 3 Sentinel) to 2 pods (Redis only).

This is the v1.7.0 release.

Changes

Core Implementation

  • Add sentinel.enabled (default: true) and sentinel.failoverTimeout (default: 10s) API fields
  • Add GetReplicationInfo() to Redis client for smart replica selection by replication offset
  • Add operator-managed failover logic (checkAndHealOperatorManagedMode)
  • Add EnsureNotPresentSentinelResources() for Sentinel resource cleanup
  • Add PromoteBestReplica() for failover with replication offset-based selection
  • Modify shutdown script to skip Sentinel failover when disabled

Documentation

  • Update README with sentinel-free mode documentation
  • Update version references to v1.7.0
  • Add connection instructions for sentinel-free mode
  • Update roadmap

Testing

  • Add unit tests for new API methods
  • Add E2E test job for sentinel-free mode:
    • Verifies NO Sentinel resources created
    • Verifies master election
    • Tests operator-managed failover
    • Verifies data survives failover

Failover behavior when sentinel.enabled=false

Condition Action
0 masters Elect best replica by replication offset (or oldest as fallback)
1 master Check health, failover if unhealthy
Multiple masters Error state requiring manual intervention

Example Usage

apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
  name: my-redis
spec:
  redis:
    replicas: 2
  sentinel:
    enabled: false  # Operator manages failover
    failoverTimeout: "10s"

Test plan

  • Unit tests pass (go test ./...)
  • Code compiles (go build ./...)
  • E2E: Sentinel resources NOT created when enabled: false
  • E2E: Operator elects master on startup
  • E2E: Operator fails over when master pod deleted
  • E2E: Data survives failover

Closes #9

Add spec.sentinel.enabled field to allow operator-managed failover instead
of Redis Sentinel, reducing pod overhead from 5 pods (2 Redis + 3 Sentinel)
to 2 pods (Redis only).

Changes:
- Add sentinel.enabled and sentinel.failoverTimeout API fields
- Add GetReplicationInfo() to Redis client for smart replica selection
- Add operator-managed failover logic (checkAndHealOperatorManagedMode)
- Add EnsureNotPresentSentinelResources() for Sentinel cleanup
- Add PromoteBestReplica() for failover with replication offset selection
- Modify shutdown script to skip Sentinel failover when disabled
- Add comprehensive unit tests for new functionality

Failover behavior when sentinel.enabled=false:
- 0 masters: elect best replica by replication offset (or oldest)
- 1 master: check health, failover if unhealthy
- Multiple masters: error state requiring manual intervention
- Document sentinel-free mode in README
- Update version references to v1.7.0
- Update roadmap to include sentinel-free feature
- Add connection instructions for sentinel-free mode
- Add E2E test job for sentinel-free architecture
- Regenerate CRD with sentinel.enabled and failoverTimeout fields
@usiegj00 usiegj00 merged commit b2b9cc4 into main Jan 25, 2026
13 checks passed
@usiegj00 usiegj00 deleted the feature/sentinel-free-architecture branch January 25, 2026 06:58
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.

Adopt Sentinel-free architecture as default (operator-managed failover)

1 participant