apiVersion: apps/v1
kind: Deployment
metadata:
  name: splunk-forwarder-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: splunk-forwarder-operator
  template:
    metadata:
      labels:
        name: splunk-forwarder-operator
    spec:
      serviceAccountName: splunk-forwarder-operator
      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
      containers:
        - name: splunk-forwarder-operator
          # Replace this with the built image name
          image: REPLACE_IMAGE
          command:
          - splunk-forwarder-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "splunk-forwarder-operator"
