apiVersion: apps/v1
kind: Deployment
metadata:
  name: metering-operator
  labels:
    app: metering-operator
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: metering-operator
  template:
    metadata:
      labels:
        app: metering-operator
        name: metering-operator
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - name: operator
        image: "quay.io/coreos/metering-ansible-operator:release-4.7"
        imagePullPolicy: Always
        args:
        - "--zap-log-level=info"
        - "--metrics-addr=:8383"
        - "--leader-election-id=metering-operator"
        - "--enable-leader-election=true"
        env:
        - name: ANSIBLE_DEBUG_LOGS
          value: "True"
        - name: ANSIBLE_VERBOSITY_METERINGCONFIG_METERING_OPENSHIFT_IO
          value: "1"
        - name: DISABLE_OCP_FEATURES
          value: "true"
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: METERING_ANSIBLE_OPERATOR_IMAGE
          value: "quay.io/coreos/metering-ansible-operator:release-4.7"
        - name: METERING_REPORTING_OPERATOR_IMAGE
          value: "quay.io/coreos/metering-reporting-operator:release-4.7"
        - name: METERING_PRESTO_IMAGE
          value: "quay.io/coreos/presto:release-4.7"
        - name: METERING_HIVE_IMAGE
          value: "quay.io/coreos/hive:release-4.7"
        - name: METERING_HADOOP_IMAGE
          value: "quay.io/coreos/hadoop:release-4.7"
        - name: GHOSTUNNEL_IMAGE
          value: "quay.io/coreos/metering-ghostunnel:release-4.7"
        ports:
        - name: http-metrics
          containerPort: 8383
        - name: cr-metrics
          containerPort: 8686
        volumeMounts:
        - mountPath: /tmp/ansible-operator/runner
          name: runner
        resources:
          limits:
            cpu: 1500m
            memory: 500Mi
          requests:
            cpu: 750m
            memory: 400Mi
      volumes:
        - name: runner
          emptyDir: {}
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      serviceAccount: metering-operator
