From ca07606b050e37995c9e05e891362545ea035b0e Mon Sep 17 00:00:00 2001 From: Kelly Date: Tue, 9 Dec 2025 11:40:11 -0700 Subject: [PATCH] feat(k8s): Add Redis deployment for production MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add k8s/redis.yaml with Redis 7 Alpine deployment - Add REDIS_HOST and REDIS_PORT to configmap - Redis configured with 200MB max memory and LRU eviction - 1GB persistent volume for data persistence 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- k8s/configmap.yaml | 2 ++ k8s/redis.yaml | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 k8s/redis.yaml diff --git a/k8s/configmap.yaml b/k8s/configmap.yaml index 3358dc63..4a881a39 100644 --- a/k8s/configmap.yaml +++ b/k8s/configmap.yaml @@ -7,3 +7,5 @@ data: NODE_ENV: "production" PORT: "3010" LOG_LEVEL: "info" + REDIS_HOST: "redis" + REDIS_PORT: "6379" diff --git a/k8s/redis.yaml b/k8s/redis.yaml new file mode 100644 index 00000000..baf7d25e --- /dev/null +++ b/k8s/redis.yaml @@ -0,0 +1,66 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-data + namespace: dispensary-scraper +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redis + namespace: dispensary-scraper +spec: + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + labels: + app: redis + spec: + containers: + - name: redis + image: redis:7-alpine + ports: + - containerPort: 6379 + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "256Mi" + cpu: "200m" + volumeMounts: + - name: redis-data + mountPath: /data + command: + - redis-server + - --appendonly + - "yes" + - --maxmemory + - "200mb" + - --maxmemory-policy + - allkeys-lru + volumes: + - name: redis-data + persistentVolumeClaim: + claimName: redis-data +--- +apiVersion: v1 +kind: Service +metadata: + name: redis + namespace: dispensary-scraper +spec: + selector: + app: redis + ports: + - port: 6379 + targetPort: 6379