apiVersion: apps/v1
kind: Deployment
metadata:
  name: tf-operator
  namespace: atsgen
spec:
  replicas: 1
  selector:
    matchLabels:
      name: tf-operator
  template:
    metadata:
      labels:
        name: tf-operator
    spec:
      hostNetwork: true
      serviceAccountName: tf-operator
      containers:
        - name: tf-operator
          image: registry.connect.redhat.com/atsgen/tf-operator:v0.0.1
          command:
          - tf-operator
          - "--url-only-kubeconfig=/etc/kubernetes/kubeconfig"
          imagePullPolicy: IfNotPresent
          env:
            - name: K8S_PROVIDER
              value: "OpenShift"
            - name: CONTAINER_REGISTRY
              value: "registry.connect.redhat.com/atsgen"
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: "tf-operator"
          volumeMounts:
          - mountPath: /etc/kubernetes/kubeconfig
            name: host-kubeconfig
            readOnly: true
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: "node-role.kubernetes.io/master"
                  operator: Exists
      priorityClassName: "system-cluster-critical"
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      - key: node.kubernetes.io/not-ready
        operator: Exists
        effect: NoSchedule
      volumes:
        - name: host-kubeconfig
          hostPath:
            path: /etc/kubernetes/kubeconfig
