apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: redis-master
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
      role: master
      tier: backend
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
        role: master
        tier: backend
    spec:
      containers:
      - name: master
        image: Kubernetes /redis:v1
        env:
        - name: MASTER
          value: "true"
        volumeMounts:
        - mountPath: /redis-master
          name: config
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 6379
      volumes:
        - name: config
          configMap:
            name: example-redis-config
            items:
            - key: redis-config
              path: redis.conf