apiVersion: apps/v1
kind: Deployment
metadata:
  name: ibm-metering-operator
  labels:
    app.kubernetes.io/instance: "ibm-metering-operator"
    app.kubernetes.io/managed-by: "ibm-metering-operator"
    app.kubernetes.io/name: "ibm-metering"
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ibm-metering-operator
  template:
    metadata:
      labels:
        name: ibm-metering-operator
        app.kubernetes.io/instance: "ibm-metering-operator"
        app.kubernetes.io/managed-by: "ibm-metering-operator"
        app.kubernetes.io/name: "ibm-metering"
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-metering-operator
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
                - ppc64le
                - s390x
      hostIPC: false
      hostNetwork: false
      hostPID: false
      containers:
        - name: ibm-metering-operator
          # Replace this with the built image name
          image: quay.io/opencloudio/ibm-metering-operator:3.8.3
          command:
          - ibm-metering-operator
          imagePullPolicy: Always
          env:
            - name: METERING_DATA_MANAGER_IMAGE
              value: quay.io/opencloudio/metering-data-manager:3.7.2
            - name: METERING_UI_IMAGE
              value: quay.io/opencloudio/metering-ui:3.7.2
            - name: METERING_MCMUI_IMAGE
              value: quay.io/opencloudio/metering-mcmui:3.7.2
            - name: METERING_REPORT_IMAGE
              value: quay.io/opencloudio/metering-report:3.7.2
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ibm-metering-operator"
            - name: SA_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
          resources:
            limits:
              cpu: 100m
              memory: 300Mi
            requests:
              cpu: 10m
              memory: 50Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
              - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
