apiVersion: apps/v1
kind: Deployment
metadata:
  name: ibm-mongodb-operator
  labels:
    app.kubernetes.io/instance: mongodbs.operator.ibm.com
    app.kubernetes.io/managed-by: mongodbs.operator.ibm.com
    app.kubernetes.io/name: mongodbs.operator.ibm.com
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ibm-mongodb-operator
  template:
    metadata:
      labels:
        name: ibm-mongodb-operator
        app.kubernetes.io/instance: mongodbs.operator.ibm.com
        app.kubernetes.io/managed-by: mongodbs.operator.ibm.com
        app.kubernetes.io/name: mongodbs.operator.ibm.com
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-mongodb-operator
      hostIPC: false
      hostNetwork: false
      hostPID: false
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - ppc64le
                      - s390x
      containers:
        - name: ibm-mongodb-operator
          resources:
            limits:
              cpu: 40m
              memory: 200Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
          # Replace this with the built image name
          image: quay.io/opencloudio/ibm-mongodb-operator:1.3.1
          command:
          - '/manager'
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ibm-mongodb-operator"
            - name: IBM_MONGODB_INSTALL_IMAGE
              value: quay.io/opencloudio/ibm-mongodb-install:3.7.0
            - name: IBM_MONGODB_IMAGE
              value: quay.io/opencloudio/ibm-mongodb:4.0.20
            - name: IBM_MONGODB_EXPORTER_IMAGE
              value: quay.io/opencloudio/ibm-mongodb-exporter:3.7.0
