apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
        - name: redis
          image: redis:6.2.3
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - mountPath: /etc/redis/redis.conf
              name: redis-config
              subPath: redis/redis.conf
      volumes:
        - name: redis-config
          configMap:
            name: redis-config
            items:
              - key: redis.conf
                path: redis/redis.conf