apiVersion: apps/v1
kind: Deployment
metadata:
  name: catalog-operator
  namespace: openshift-operator-lifecycle-manager
  labels:
    app: catalog-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    include.release.openshift.io/single-node-developer: "true"
spec:
  strategy:
    type: RollingUpdate
  replicas: 1
  selector:
    matchLabels:
      app: catalog-operator
  template:
    metadata:
      labels:
        app: catalog-operator
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
    spec:
      serviceAccountName: olm-operator-serviceaccount
      volumes:
        - name: srv-cert
          secret:
            secretName: catalog-operator-serving-cert
        - name: profile-collector-cert
          secret:
            secretName: pprof-cert
      containers:
        - name: catalog-operator
          volumeMounts:
            - name: srv-cert
              mountPath: "/srv-cert"
              readOnly: true
            - name: profile-collector-cert
              mountPath: "/profile-collector-cert"
              readOnly: true
          command:
            - /bin/catalog
          args:
            - '-namespace'
            - openshift-marketplace
            - -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest
            - -opmImage=quay.io/operator-framework/configmap-operator-registry:latest
            - -util-image
            - quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
            - -writeStatusName
            - operator-lifecycle-manager-catalog
            - --tls-cert
            - /srv-cert/tls.crt
            - --tls-key
            - /srv-cert/tls.key
            - --client-ca
            - /profile-collector-cert/tls.crt
          image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8443
              name: metrics
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8443
              scheme: HTTPS
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8443
              scheme: HTTPS
          terminationMessagePolicy: FallbackToLogsOnError
          resources:
            requests:
              cpu: 10m
              memory: 80Mi
          env:
            - name: RELEASE_VERSION
              value: "0.0.1-snapshot"
      nodeSelector:
        kubernetes.io/os: linux
        node-role.kubernetes.io/master: ""
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoExecute
          key: node.kubernetes.io/unreachable
          operator: Exists
          tolerationSeconds: 120
        - effect: NoExecute
          key: node.kubernetes.io/not-ready
          operator: Exists
          tolerationSeconds: 120
      priorityClassName: system-cluster-critical
