apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: session-dev
  name: redis-cache-aof
  labels:
    app: redis-cache-aof
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: redis-cache-aof
  template:
    metadata:
      labels:
        app: redis-cache-aof
    spec:
      containers:
      - name: redis-cache-aof
        image: redis:latest
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 6379
        command: #["redis-server", "--appendonly", "yes", "--appendfsync", "everysec"]
          - redis-server
          - "/redis-master/redis.conf"
        env:
          # - name: ALLOW_EMPTY_PASSWORD
          #   value: "yes"
          - name: REDIS_PASSWORD
            value: Password12#$
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 300m
            memory: 256Mi
        volumeMounts:
        - name: persistent-storage
          mountPath: /data
        - name: config
          mountPath: /redis-master
      volumes:
      - name: persistent-storage
        persistentVolumeClaim:
          claimName: redis-cache-aof
      - name: config
        configMap:
          name: redis-cache-aof
          items:
          - key: redis.conf
            path: redis.conf
