apiVersion: apps/v1
kind: Deployment
metadata:
  name: metering-ansible-operator-registry
  labels:
    registry.operator.metering-ansible: "true"
    tenant: ""
spec:
  replicas: 1
  selector:
    matchLabels:
      registry.operator.metering-ansible: "true"
      tenant: ""
  template:
    metadata:
      labels:
        registry.operator.metering-ansible: "true"
        tenant: ""
      name: metering-ansible-operator-registry
    spec:
      initContainers:
      - name: mutate-csv-and-generate-sqlite-db
        image: ${IMAGE_METERING_ANSIBLE_OPERATOR_REGISTRY}
        imagePullPolicy: Always
        command:
        - sh
        args:
        - /scripts/init-bundle-registry.sh
        volumeMounts:
        - name: workdir
          mountPath: /bundle
        env:
        - name: IMAGE_METERING_ANSIBLE_OPERATOR
          value: registry.svc.ci.openshift.org/ocp/4.6:metering-ansible-operator
        - name: IMAGE_METERING_REPORTING_OPERATOR
          value: registry.svc.ci.openshift.org/ocp/4.6:metering-reporting-operator
        - name: IMAGE_METERING_PRESTO
          value: registry.svc.ci.openshift.org/ocp/4.6:metering-presto
        - name: IMAGE_METERING_HIVE
          value: registry.svc.ci.openshift.org/ocp/4.6:metering-hive
        - name: IMAGE_METERING_HADOOP
          value: registry.svc.ci.openshift.org/ocp/4.6:metering-hadoop
        - name: IMAGE_GHOSTUNNEL
          value: registry.svc.ci.openshift.org/ocp/4.6:ghostunnel
        - name: IMAGE_OAUTH_PROXY
          value: registry.svc.ci.openshift.org/ocp/4.6:oauth-proxy

      containers:
      - name: metering-ansible-operator-registry
        image: ${IMAGE_METERING_ANSIBLE_OPERATOR_REGISTRY}
        imagePullPolicy: Always
        command:
        - /usr/bin/registry-server
        - --database=/bundle/bundles.db
        volumeMounts:
        - name: workdir
          mountPath: /bundle
        ports:
        - containerPort: 50051
          name: grpc
          protocol: TCP
        livenessProbe:
          exec:
            command:
            - grpc_health_probe
            - -addr=localhost:50051
        readinessProbe:
          exec:
            command:
            - grpc_health_probe
            - -addr=localhost:50051
        resources:
          requests:
            cpu: 10m
            memory: 100Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      volumes:
      - name: workdir
        emptyDir: {}
