Skip to content

Build config service for guild-to-pod assignments #233

@vcarl

Description

@vcarl

Context

Part of load balancer architecture work (see PR #228 for full analysis).

Risk: Medium-High | Reward: High | Code Changes: Required (new service)

Description

Build a new service that manages guild-to-pod assignments. This service tracks which gateway pod handles which guilds and provides an API for routing decisions.

Architecture

HTTP Pods → Config Service → PostgreSQL
                ↓
           Gateway Pods (query for their assigned guilds)

Service Discovery

Use Kubernetes DNS (not hardcoded URLs):

  • Config service: config-service.default.svc.cluster.local:3001
  • Short name within namespace: config-service:3001

API Endpoints

GET  /health                    - Health check
GET  /guild/:guildId/pod        - Which pod handles this guild?
POST /guild/:guildId/assign     - Assign guild to pod
GET  /pod/:podName/guilds       - List guilds for a pod
POST /rebalance                 - Trigger guild rebalancing

Tasks

  • Create apps/config-service/ directory structure
  • Implement PostgreSQL connection using same patterns as main app
  • Implement guild assignment logic (least-loaded pod)
  • Implement health endpoint
  • Implement guild lookup endpoint
  • Implement pod guilds list endpoint
  • Create Dockerfile.config for separate image
  • Add GitHub Actions workflow to publish to ghcr
  • Deploy to staging with PostgreSQL (Deploy PostgreSQL StatefulSet for config service #231)
  • Test guild assignment and lookup

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions