apiVersion: apps/v1
kind: Deployment
metadata:
  name: benchmark-operator
  namespace: my-ripsaw
spec:
  replicas: 1
  selector:
    matchLabels:
      name: benchmark-operator
  template:
    metadata:
      labels:
        name: benchmark-operator
    spec:
      tolerations:
      - key: role
        value: workload
        effect: NoSchedule
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            preference:
              matchExpressions:
              - key: node-role.kubernetes.io/workload
                operator: In
                values:
                - ""
      serviceAccountName: benchmark-operator
      containers:
        - name: benchmark-operator
          image: quay.io/benchmark-operator/benchmark-operator:master
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "benchmark-operator"
            - name: WORKER_BENCHMARK_RIPSAW_CLOUDBULLDOZER_IO
              value: "1"
            - name: ANSIBLE_VERBOSITY
              value: "4"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
        - name: redis-master
          image: k8s.gcr.io/redis:v1
          env:
            - name: MASTER
              value: "true"
          ports:
            - containerPort: 6379
          resources:
            limits:
              cpu: "2.0"
          volumeMounts:
            - mountPath: /redis-master-data
              name: data
      volumes:
        - name: data
          emptyDir: {}
        - name: runner
          emptyDir: {}
