apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
        pipelineId: '{{.Env.CI_PIPELINE_ID}}'
    spec:
      securityContext:
        runAsUser: 2000
        fsGroup: 2000
      volumes:
        - name: persistence
          persistentVolumeClaim:
            claimName: redis
      containers:
        - name: redis
          image: redis:5-alpine
          imagePullPolicy: Always
          resources: 
            requests:
              memory: "128Mi"
              cpu: "50m"
            limits:
              memory: "256Mi"
              cpu: "200m"
          ports:
            - containerPort: 6379
          volumeMounts:
            - mountPath: "/data"
              name: persistence
      imagePullSecrets:
        - name: regsecret
