---
kind: ReplicationController
apiVersion: v1
metadata:
  name: redis-slave
  labels:
    app: redis
    role: slave
spec:
  replicas: 2
  selector:
    app: redis
    role: slave
  template:
    metadata:
      labels:
        app: redis
        role: slave
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '9121'
    spec:
      containers:
      - name: redis-slave
        image: kubernetes/redis-slave:v2
        ports:
        - name: redis-server
          containerPort: 6379
      - name: redis-metrics-exporter
        image: oliver006/redis_exporter
        ports:
        - name: metrics
          containerPort: 9121
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: purpose
                operator: In
                values:
                - monitoring
