apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  progressDeadlineSeconds: 120
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: redis
  template:
    metadata:
      labels:
        app.kubernetes.io/name: redis
    spec:
      containers:
      - name: redis
        image: redis
        imagePullPolicy: IfNotPresent
        ports:
        - name: redis
          containerPort: 6579
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 1Gi
          requests:
            cpu: 100m
            memory: 128Mi
        securityContext:
          runAsNonRoot: true
          runAsUser: 1000
        lifecycle:
          preStop:
            exec:
              command:
              - sleep
              - "10"
      serviceAccountName: peercalls
      securityContext:
        fsGroup: 1000
