apiVersion: apps/v1
kind: Deployment
metadata:
  name: metering-operator
  labels:
    app: metering-operator
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: metering-operator
  template:
    metadata:
      labels:
        app: metering-operator
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - name: metering-operator
        image: "quay.io/openshift/origin-metering-helm-operator:4.1"
        args: ["run-operator.sh"]
        imagePullPolicy: Always
        env:
        - name: HELM_RELEASE_CRD_NAME
          value: "Metering"
        - name: HELM_RELEASE_CRD_API_GROUP
          value: "metering.openshift.io"
        - name: HELM_CHART_PATH
          value: "/openshift-metering"
        - name: ALL_NAMESPACES
          value: "false"
        - name: TARGET_NAMESPACES
          valueFrom:
              fieldRef:
                fieldPath: metadata.annotations['olm.targetNamespaces']

        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: HELM_RECONCILE_INTERVAL_SECONDS
          value: "30"
        - name: METERING_HELM_OPERATOR
          value: "quay.io/openshift/origin-metering-helm-operator:4.1"
        - name: METERING_REPORTING_OPERATOR
          value: "quay.io/openshift/origin-metering-reporting-operator:4.1"
        - name: METERING_PRESTO
          value: "quay.io/openshift/origin-metering-presto:4.1"
        - name: METERING_HIVE
          value: "quay.io/openshift/origin-metering-hive:4.1"
        - name: METERING_HADOOP
          value: "quay.io/openshift/origin-metering-hadoop:4.1"
        resources:
          limits:
            cpu: 500m
            memory: 300Mi
          requests:
            cpu: 200m
            memory: 200Mi

      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      serviceAccount: metering-operator

