PostgreSQL & Redis¶
helm-me has built-in support for PostgreSQL and Redis as first-class components.
PostgreSQL¶
This creates:
- A Deployment running
postgres:16 - A Service on port 5432
- A PersistentVolumeClaim for data
- A Secret with connection credentials
Auto-Generated Secret Keys¶
| Key | Example Value |
|---|---|
DATABASE_URL |
postgresql://appuser:supersecret@myapp-db:5432/myapp |
POSTGRES_DB |
myapp |
POSTGRES_USER |
appuser |
POSTGRES_PASSWORD |
supersecret |
Reference from Web Components¶
components:
db:
type: postgresql
database: myapp
user: appuser
password: secret123
backend:
type: web
image: myapp:latest
port: 8000
secretEnv:
DATABASE_URL:
component: db
key: DATABASE_URL
Redis¶
Redis with Persistent Storage¶
Reference Redis from Web Components¶
Use serviceEnv for the host and secretEnv for the password:
components:
cache:
type: redis
password: secret123
backend:
type: web
image: myapp:latest
port: 8000
env:
REDIS_PORT: "6379"
serviceEnv:
REDIS_HOST:
component: cache
secretEnv:
REDIS_PASSWORD:
component: cache
key: REDIS_PASSWORD
Full Example¶
See examples/with_dbs/ for a complete PostgreSQL + Redis + backend example.