apiVersion: apps/v1
kind: Deployment
metadata:
  name: primary-deployment
  labels:
    name: redis-primary
spec:
  replicas: 1
  selector:
    matchLabels:
      name: redis-primary
  template:
    metadata:
      labels:
        name: redis-primary
    spec:
      subdomain: primary
      containers:
        - name: redis
          image: redis:3.2.0-alpine
          command:
            - "redis-server"
          args:
            - "--protected-mode"
            - "no"
          ports:
            - containerPort: 6379
          volumeMounts:
            - mountPath: /redis-master-data
              name: data
      volumes:
        - name: data
          emptyDir: {}