Flexible Storage
GreenKube supports PostgreSQL and SQLite through shared repository interfaces. Select the backend in Helm values or with the corresponding environment variables.
Supported Backends
Section titled “Supported Backends”PostgreSQL (Recommended)
Section titled “PostgreSQL (Recommended)”- Supported production backend
- Bundled in the Helm chart as a StatefulSet, or use an external PostgreSQL database
- Persistent storage and configurable connection pooling
config: db: type: postgrespostgres: enabled: true persistence: enabled: true size: 10GiSQLite (Development & Standalone)
Section titled “SQLite (Development & Standalone)”- Zero infrastructure — single file database
- Perfect for local development and testing
- Great for single-node standalone deployments
- SCD2 node snapshots — Slowly Changing Dimensions Type 2 tracking stores only changed node rows (
instance_type,vcpu,memory_gb,region,provider,zone), avoiding write amplification on stable clusters
config: db: type: sqlite path: /data/greenkube_data.dbData Retention & Compression
Section titled “Data Retention & Compression”GreenKube uses a configurable multi-tier retention strategy:
| Tier | Default | Env Var |
|---|---|---|
| Raw metrics (5-min) | 7 days | METRICS_RAW_RETENTION_DAYS |
| Hourly aggregates | Infinite | METRICS_AGGREGATED_RETENTION_DAYS (-1 = infinite) |
| Compression threshold | 24 h | METRICS_COMPRESSION_AGE_HOURS |
Raw metrics are automatically compressed to hourly aggregates after the threshold, keeping storage compact without losing historical visibility. Aggregates are retained indefinitely by default unless a limit is configured.
Related
Section titled “Related”- Storage Architecture — Technical deep-dive
- Configuration Guide — All storage options
- Architecture Overview — System design principles