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/coreos/metering-ansible-operator:release-4.5"
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /tmp/ansible-operator/runner
          name: runner
          readOnly: true
      - name: operator
        image: "quay.io/coreos/metering-ansible-operator:release-4.5"
        imagePullPolicy: Always
        env:
        - name: OPERATOR_NAME
          value: "metering-ansible-operator"
        - name: DISABLE_OCP_FEATURES
          value: "true"
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: METERING_ANSIBLE_OPERATOR_IMAGE
          value: "quay.io/coreos/metering-ansible-operator:release-4.5"
        - name: METERING_REPORTING_OPERATOR_IMAGE
          value: "quay.io/coreos/metering-reporting-operator:release-4.5"
        - name: METERING_PRESTO_IMAGE
          value: "quay.io/coreos/presto:release-4.5"
        - name: METERING_HIVE_IMAGE
          value: "quay.io/coreos/hive:release-4.5"
        - name: METERING_HADOOP_IMAGE
          value: "quay.io/coreos/hadoop:release-4.5"
        - name: GHOSTUNNEL_IMAGE
          value: "quay.io/coreos/metering-ghostunnel:release-4.5"
        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

