apiVersion: apps/v1
kind: Deployment

metadata:
  namespace: singouins-dev
  name: sep-backend-redis
  labels:
    tier: sep-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
      tier: sep-backend
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9121"
      labels:
        app: redis
        tier: sep-backend
    spec:
      restartPolicy: Always

      containers:
      - name: sep-backend-redis
        image: redis:6.0-alpine
        command: ["redis-server", "/etc/redis/redis.conf"]
        resources:
          limits:
            memory: 64Mi
            cpu: 50m
          requests:
            memory: 32Mi
            cpu: 10m
        ports:
        - containerPort: 6379
        volumeMounts:
        - mountPath: /etc/redis
          name: config
      - name: sep-backend-redis-exporter
        image: oliver006/redis_exporter:v1.33.0-alpine
        resources:
          limits:
            memory: 32Mi
            cpu: 10m
          requests:
            memory: 16Mi
            cpu: 10m
        ports:
        - containerPort: 9121

      volumes:
      - name: config
        configMap:
          name: sep-backend-redis-conf
          items:
          - key: redis-conf
            path: redis.conf
