# ============================================================================= # AI Software Factory — Redis 7 (Deployment + Service) # # Used for caching, BullMQ job queues and realtime presence/pubsub. # Single replica for simplicity. For production, prefer MANAGED ElastiCache / # Memorystore / AOF-backed replicas — a lost Redis queue means lost jobs. # # PVC NOTE: # Redis persistence (AOF) is enabled below with a ReadWriteOnce PVC. # If you switch to managed Redis, delete the volume + volumeMount entirely # and point REDIS_URL at the managed endpoint via the factory-config # ConfigMap / factory-secrets Secret. # ============================================================================= apiVersion: apps/v1 kind: Deployment metadata: name: redis labels: app.kubernetes.io/name: redis app.kubernetes.io/component: cache spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: redis strategy: type: Recreate # single-replica with a RWO PVC template: metadata: labels: app.kubernetes.io/name: redis app.kubernetes.io/component: cache spec: containers: - name: redis image: redis:7-alpine args: - redis-server - --appendonly - "yes" - --appendfsync - everysec - --maxmemory - 1gb - --maxmemory-policy - allkeys-lru # If you enable a password, create a factory-db style secret with # REDIS_PASSWORD and add: # - --requirepass "$(REDIS_PASSWORD)" # and pass REDIS_PASSWORD via envFrom secretRef. ports: - containerPort: 6379 name: redis resources: requests: cpu: 250m memory: 256Mi limits: cpu: "1" memory: 1Gi volumeMounts: - name: redisdata mountPath: /data readinessProbe: tcpSocket: port: 6379 periodSeconds: 5 livenessProbe: tcpSocket: port: 6379 periodSeconds: 15 volumes: - name: redisdata persistentVolumeClaim: # PVC `factory-redis` must exist (20Gi example). See README: # kubectl apply -f - <