feat: remove per-customer valkey, use managed Valkey with REDIS_KEY_PREFIX
This commit is contained in:
@@ -38,6 +38,11 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: lunarfront-secrets
|
name: lunarfront-secrets
|
||||||
key: redis-url
|
key: redis-url
|
||||||
|
- name: REDIS_KEY_PREFIX
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: lunarfront-secrets
|
||||||
|
key: redis-key-prefix
|
||||||
- name: JWT_SECRET
|
- name: JWT_SECRET
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|||||||
@@ -26,19 +26,6 @@ frontend:
|
|||||||
cpu: 200m
|
cpu: 200m
|
||||||
memory: 128Mi
|
memory: 128Mi
|
||||||
|
|
||||||
valkey:
|
|
||||||
image:
|
|
||||||
repository: valkey/valkey
|
|
||||||
tag: "8"
|
|
||||||
port: 6379
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 64Mi
|
|
||||||
limits:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 128Mi
|
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
host: ""
|
host: ""
|
||||||
className: nginx
|
className: nginx
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ declare module 'fastify' {
|
|||||||
|
|
||||||
export const redisPlugin = fp(async (app) => {
|
export const redisPlugin = fp(async (app) => {
|
||||||
const redisUrl = process.env.REDIS_URL ?? 'redis://localhost:6379'
|
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)
|
app.decorate('redis', redis)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user