apiVersion: apps/v1
kind: Deployment
metadata:
  name: contrail-operator
  namespace: contrail
spec:
  replicas: 3
  selector:
    matchLabels:
      name: contrail-operator
  template:
    metadata:
      labels:
        name: contrail-operator
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
                - key: name
                  operator: In
                  values:
                  - "contrail-operator"
            topologyKey: kubernetes.io/hostname
      nodeSelector:
        node-role.kubernetes.io/master: ""
      serviceAccountName: contrail-operator
      hostNetwork: true
      imagePullSecrets:
      - name: contrail-registry
      tolerations:
        - effect: NoExecute
          operator: Exists
        - effect: NoSchedule
          operator: Exists
      containers:
        - name: contrail-operator
          # Replace this with the built image name
          image: <CONTRAIL_REGISTRY>/contrail-operator:<CONTRAIL_VERSION>
          imagePullPolicy: IfNotPresent
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "contrail-operator"
            - name: CLUSTER_TYPE
              value: "Openshift"
