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: beta.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@sha256:e6e017c37e6d174cc819207a6b4b1354e33c6f806e9467dbae304c70ee2a7298
          command:
          - ibm-metering-operator
          imagePullPolicy: Always
          env:
            - name: IMAGE_SHA_OR_TAG_DM
              value: sha256:9f1928a52342e59c39265d2256da19ae1541fea3b51d44dd8ee3f9316d19e4cb
            - name: IMAGE_SHA_OR_TAG_UI
              value: sha256:9e7488fa8161a16a62a0cbf10928c78d9687dd20fedcc61c023278bcb127abeb
            - name: IMAGE_SHA_OR_TAG_MCMUI
              value: sha256:8c968eec159f1d2c6066d322a602025e3f31d4596a92f08ab9a46db4c35aac7f
            - name: IMAGE_SHA_OR_TAG_REPORT
              value: sha256:a6a7a20be285138ccf680926240b63b38f6eeb5d0e8e552365d277c9f12d5ddd
            - 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
