apiVersion: apps/v1
kind: Deployment

metadata:
  namespace: singouins-dev
  name: sep-backend-redis-sub
  labels:
    tier: sep-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-sub
      tier: sep-backend
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "false"
        prometheus.io/port: "5000"
      labels:
        app: redis-sub
        tier: sep-backend
    spec:

      containers:
      - name: sep-backend-redis-sub
        image: lordslair/redsub:daf068f
        resources:
          limits:
            memory: 32Mi
            cpu: 20m
          requests:
            memory: 16Mi
            cpu: 10m
        env:
        # Reminder, Redis needs to be set with, at minimum :
        # redis-cli> CONFIG SET notify-keyspace-events s$xE
        # Redis variables
        - name: SEP_REDIS_DB
          valueFrom:
            secretKeyRef:
              name: sep-backend-redis-secret
              key: redis-base
        - name: SEP_REDIS_SUB_PATH
          value: '*'
        - name: SEP_REDIS_SUB_VERBOSE
          value: 'True'
        # Other env vars
        - name: PYTHONUNBUFFERED
          value: 'True'
        - name: PYTHONIOENCODING
          value: 'UTF-8'
