apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  namespace: production
spec:
  selector:
    matchLabels:
      app: redis
  strategy:
    type: Recreate
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - image: redis:5.0-alpine
        name: redis
        ports:
        - containerPort: 6379
        volumeMounts:
        - mountPath: /data
          name: redisdata
        resources:
          requests:
            memory: 2G
            cpu: 400m
          limits:
            memory: 6G
      restartPolicy: Always
      volumes:
      - name: redisdata
        persistentVolumeClaim:
          claimName: redisdata
