apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  namespace: instavote
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: back
      role: redis
  minReadySeconds: 10
  template:
    metadata:
      labels:
        app: redis
        role: redis
        tier: back
        version: latest
    spec:
      containers:
      - image: schoolofdevops/redis:latest
        imagePullPolicy: Always
        name: redis
        ports:
        - containerPort: 6379
          protocol: TCP
        volumeMounts:
          - name:  redis
            subPath: redis.conf
            mountPath: /etc/redis.conf
      restartPolicy: Always
      volumes:
        - name: redis
          configMap:
            name: redis