NatLabRockies / NatLabRockies/openstudio-server-helm
Phase 2: Redis Sentinel HA Deployment for 10k-worker scaling
Nobody has claimed this yet.
- Dominant language
- Go Template
- Stars
- 12
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The single Redis pod (RWO PVC, Recreate strategy) is the hardest scaling ceiling at ~2k-3k workers. Each worker maintains a persistent BRPOP connection; at 10,000 concurrent connections, Redis CPU saturates before workers are fully utilized. Single-pod Redis is also a SPOF — any restart kills all queue operations.
What Phase 1 Did
- Scaled Redis CPU 3→8 cores, memory 4Gi→16Gi
- Set
maxclients: 50000andtcpBacklog: 511 - Tuned
appendfsync: everysecand disabled RDB saves (save: "") - Scaffolded
ha.mode: standalone|sentinelin values.yaml with sentinel sidecar container inredis-deploy.yaml - Added
redis.ha.sentinelconfig block with quorum/failover/parallel-syncs
What Remains (This Issue)
- Sentinel deployment template: Convert the current single-pod Deployment into a 3-pod StatefulSet with headless service for stable network identities (pod-N.service)
- Sentinel discovery service: Create a
redis-sentinelservice (ClusterIP or headless) so workers discover the current Redis primary - Primary/replica discovery: Add an init container or sidecar that queries sentinel to resolve the current primary and populates
REDIS_URLdynamically - Read splitting (optional): Route BRPOP to primary, read-only queries to replicas
- Validation: Verify automatic failover works when the primary pod is deleted
Design Notes
- Sentinel quorum of 2 (with 3 replicas) prevents split-brain
- Worker pods must be updated to query sentinel for primary address on startup
- The sentinel sidecar is already scaffolded in
redis-deploy.yamlbut the full StatefulSet + headless service template is needed - RWO PVC per pod (not shared) — each has its own AOF/RDB volume
- Phase 1 HA mode is wired but disabled by default (
mode: standalone) to maintain backward compat
References
.agents/results/result-tf-infra.md— B1: Single Redis Instance (CRITICAL)openstudio-server/values.yaml—redis.haconfig blockopenstudio-server/templates/redis/redis-deploy.yaml— sentinel sidecar scaffoldopenstudio-server/values.schema.json— HA mode validation
Acceptance Criteria
- 3-pod Redis StatefulSet with stable network identities
- Sentinel sidecar auto-configures primary/replica
- Workers discover primary via sentinel, not hardcoded DNS
- Automatic failover completes in < 30s when primary is killed
- No data loss during failover (AOF appendfsync everysec)
- Backward compatible — standalone mode still works when
ha.mode: standalone
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing openstudio-server/values.yaml, values.schema.json, and templates/redis/redis-deploy.yaml, then trace how workers receive REDIS_URL. Implement and validate the StatefulSet, services, Sentinel-based discovery, and standalone compatibility against the listed acceptance criteria, including failover and data-loss checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes, redis
- Domain
- databases, devops, distributed-systems, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100