---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tf-operator
  namespace: tf
spec:
  replicas: 1
  selector:
    matchLabels:
      name: tf-operator
  template:
    metadata:
      labels:
        name: tf-operator
    spec:
      serviceAccountName: tf-operator
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      nodeSelector:
        node-role.kubernetes.io/master: ""
      restartPolicy: Always
      tolerations:
        - effect: NoExecute
          operator: Exists
        - effect: NoSchedule
          operator: Exists
      containers:
        - name: tf-operator
          image: tf-operator
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "tf-operator"
