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
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - name: ansible
        command:
        - /opt/ansible/scripts/ansible-logs.sh
        - /tmp/ansible-operator/runner
        - stdout
        image: "quay.io/openshift/origin-metering-ansible-operator:4.3"
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /tmp/ansible-operator/runner
          name: runner
          readOnly: true
      - name: operator
        image: "quay.io/openshift/origin-metering-ansible-operator:4.3"
        imagePullPolicy: Always
        env:
        - name: OPERATOR_NAME
          value: "metering-ansible-operator"
        - name: DISABLE_OCP_FEATURES
          value: "false"
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: METERING_ANSIBLE_OPERATOR_IMAGE
          value: "quay.io/openshift/origin-metering-ansible-operator:4.3"
        - name: METERING_REPORTING_OPERATOR_IMAGE
          value: "quay.io/openshift/origin-metering-reporting-operator:4.3"
        - name: METERING_PRESTO_IMAGE
          value: "quay.io/openshift/origin-metering-presto:4.3"
        - name: METERING_HIVE_IMAGE
          value: "quay.io/openshift/origin-metering-hive:4.3"
        - name: METERING_HADOOP_IMAGE
          value: "quay.io/openshift/origin-metering-hadoop:4.3"
        - name: GHOSTUNNEL_IMAGE
          value: "quay.io/openshift/origin-ghostunnel:4.3"
        - name: OAUTH_PROXY_IMAGE
          value: "quay.io/openshift/origin-oauth-proxy:4.3"
        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

