apiVersion: apps/v1
kind: Deployment
metadata:
  name: marketplace-operator
  namespace: openshift-marketplace
  annotations:
    config.openshift.io/inject-proxy: "marketplace-operator"
spec:
  replicas: 1
  selector:
    matchLabels:
      name: marketplace-operator
  template:
    metadata:
      labels:
        name: marketplace-operator
    spec:
      serviceAccountName: marketplace-operator
      nodeSelector:
        node-role.kubernetes.io/master: ""
      priorityClassName: "system-cluster-critical"
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: Exists
        effect: "NoSchedule"
      - key: "node.kubernetes.io/unreachable"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120
      containers:
        - name: marketplace-operator
          image: quay.io/openshift/origin-operator-marketplace:latest
          ports:
          - containerPort: 60000
            name: metrics
          - containerPort: 8080
            name: healthz
          command:
          - marketplace-operator
          args:
          - -registryServerImage=quay.io/openshift/origin-operator-registry
          - -defaultsDir=/defaults
          - -clusterOperatorName=marketplace
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
          resources:
            requests:
              cpu: 10m
              memory: 50Mi
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "marketplace-operator"
            - name: "RELEASE_VERSION"
              # The string "0.0.1-snapshot" is substituted by the CVO with the version of the payload
              value: "0.0.1-snapshot"
          volumeMounts:
            - name: marketplace-trusted-ca
              mountPath: /etc/pki/ca-trust/extracted/pem/
      volumes:
        - name: marketplace-trusted-ca
          configMap:
            optional: true
            name: marketplace-trusted-ca
            items:
            - key: ca-bundle.crt
              path: tls-ca-bundle.pem
