Skip to content

[Feature Request]: Add optional persistence support for PostgreSQL and Redis in mcp-stack Helm chart #1308

@SharkyND

Description

@SharkyND

Add optional persistence support for PostgreSQL and Redis in mcp-stack Helm chart

Problem Statement

The current mcp-stack Helm chart lacks proper persistence configuration options for PostgreSQL and Redis components, leading to several issues:

  1. Data Loss Risk: PostgreSQL data is lost when pods restart without persistent storage
  2. Inconsistent Resource Naming: PV/PVC resources use hardcoded names instead of Helm template helpers
  3. No Redis Persistence Option: Redis has no persistence configuration for scenarios requiring data durability
  4. Missing Backup Integration: No support for backup tool annotations (Velero, etc.)
  5. Poor Conditional Logic: Missing fallback mechanisms when persistence is disabled

Current Behavior

  • PostgreSQL uses hardcoded PVC name postgres-pv-claim
  • Redis has no persistence options at all
  • No conditional logic for enabling/disabling persistence
  • Resource labels don't follow Helm best practices
  • No backup tool integration points

Desired Behavior

  • Conditional Persistence: Support both persistent and ephemeral storage modes
  • Proper Helm Templating: Use template helpers for consistent resource naming
  • Redis Persistence Options: Optional persistence with AOF/RDB configuration
  • Backup Annotations: Support for backup tools like Velero
  • Production-Ready Defaults: Sensible defaults with data protection policies

Proposed Solution

  1. Add Redis persistence templates:

    • redis-pv.yaml and redis-pvc.yaml with conditional rendering
    • configmap-redis.yaml for persistence configuration
  2. Enhance PostgreSQL templates:

    • Use Helm template helpers for consistent naming
    • Add conditional volume mounting (PVC vs emptyDir)
    • Add backup annotations support
  3. Update values.yaml:

    • Add Redis persistence configuration section
    • Add backup annotation examples
    • Set safe reclaim policies

Configuration Example

postgres:
  persistence:
    enabled: true
    reclaimPolicy: Retain
    annotations:
      backup.velero.io/backup-volumes: "postgres-data"

redis:
  persistence:
    enabled: false  # Default: caching mode
    size: 1Gi
    reclaimPolicy: Retain

### 🧭 Type of Feature

Please select the most appropriate category:

- [x] Enhancement to existing functionality
- [ ] New feature or capability
- [ ] New MCP-compliant server
- [ ] New component or integration
- [ ] Developer tooling or test improvement
- [ ] Packaging, automation and deployment (ex: pypi, docker, quay.io, kubernetes, terraform)
- [ ] Other (please describe below)


### 📓 Additional Context

Problem Statement
The current mcp-stack Helm chart lacks proper persistence configuration options for PostgreSQL and Redis components, leading to several issues:

Data Loss Risk: PostgreSQL data is lost when pods restart without persistent storage
Inconsistent Resource Naming: PV/PVC resources use hardcoded names instead of Helm template helpers
No Redis Persistence Option: Redis has no persistence configuration for scenarios requiring data durability
Missing Backup Integration: No support for backup tool annotations (Velero, etc.)
Poor Conditional Logic: Missing fallback mechanisms when persistence is disabled
Current Behavior
PostgreSQL uses hardcoded PVC name postgres-pv-claim
Redis has no persistence options at all
No conditional logic for enabling/disabling persistence
Resource labels don't follow Helm best practices
No backup tool integration points

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageIssues / Features awaiting triage

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions