apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: redis-slave
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
      role: slave
      tier: backend
  replicas: 2
  template:
    metadata:
      labels:
        app: redis
        role: slave
        tier: backend
    spec:
      containers:
      - name: slave
        image: docker.io/redis:5.0
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        command: ["redis-server", "--slaveof", "redis-master", "6379"]
        ports:
        - containerPort: 6379
