feat: remove per-customer valkey, use managed Valkey with REDIS_KEY_PREFIX

This commit is contained in:
Ryan Moon
2026-04-03 19:48:40 -05:00
parent 5df914a40f
commit 358e07b1d5
3 changed files with 7 additions and 14 deletions

View File

@@ -38,6 +38,11 @@ spec:
secretKeyRef:
name: lunarfront-secrets
key: redis-url
- name: REDIS_KEY_PREFIX
valueFrom:
secretKeyRef:
name: lunarfront-secrets
key: redis-key-prefix
- name: JWT_SECRET
valueFrom:
secretKeyRef:

View File

@@ -26,19 +26,6 @@ frontend:
cpu: 200m
memory: 128Mi
valkey:
image:
repository: valkey/valkey
tag: "8"
port: 6379
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
ingress:
host: ""
className: nginx

View File

@@ -9,7 +9,8 @@ declare module 'fastify' {
export const redisPlugin = fp(async (app) => {
const redisUrl = process.env.REDIS_URL ?? 'redis://localhost:6379'
const redis = new Redis(redisUrl)
const keyPrefix = process.env.REDIS_KEY_PREFIX ? `${process.env.REDIS_KEY_PREFIX}:` : ''
const redis = new Redis(redisUrl, { keyPrefix })
app.decorate('redis', redis)