apiVersion: apps/v1
kind: Deployment
metadata:
  name: osd-metrics-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      name: osd-metrics-exporter
  template:
    metadata:
      labels:
        name: osd-metrics-exporter
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - preference:
                matchExpressions:
                  - key: node-role.kubernetes.io/infra
                    operator: Exists
              weight: 1
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists
      serviceAccountName: osd-metrics-exporter
      containers:
        - name: osd-metrics-exporter
          # Replace this with the built image name
          image: REPLACE_IMAGE
          command:
            - osd-metrics-exporter
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "osd-metrics-exporter"
