apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Redis for storing semi-persistent data like user sessions.
  labels:
    deploy: sourcegraph
  name: redis-store
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: redis-store
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: redis-store
    spec:
      containers:
      - command:
        - redis-server
        - /etc/redis/redis.conf
        image: sourcegraph/redis:18-02-07_8205764_3.2-alpine@sha256:f2957e0973ef16968d4bfacfae5ab08da985257aa7ce358a85152275e3da78e8
        livenessProbe:
          initialDelaySeconds: 30
          tcpSocket:
            port: redis
        name: redis
        ports:
        - containerPort: 6379
          name: redis
        readinessProbe:
          initialDelaySeconds: 5
          tcpSocket:
            port: redis
        resources:
          limits:
            cpu: "1"
            memory: 6Gi
          requests:
            cpu: "1" 
            memory: 6Gi
        volumeMounts:
        - mountPath: /redis-data
          name: redis-data
        - mountPath: /etc/redis
          name: config
          readOnly: true
      - image: sourcegraph/redis_exporter:18-02-07_bb60087_v0.15.0@sha256:282d59b2692cca68da128a4e28d368ced3d17945cd1d273d3ee7ba719d77b753
        name: redis-exporter
        ports:
        - containerPort: 9121
          name: redisexp
        resources:
          limits:
            cpu: 10m
            memory: 100Mi
          requests:
            cpu: 10m
            memory: 100Mi
      securityContext:
        runAsUser: 0
      volumes:
      - name: redis-data
        persistentVolumeClaim:
          claimName: redis-store
      - configMap:
          name: redis-store
        name: config
