apiVersion: apps/v1
kind: Deployment
metadata:
  name: prow-exporter
  namespace: prow
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: prow-exporter
  template:
    metadata:
      labels:
        app.kubernetes.io/name: prow-exporter
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '9855'
    spec:
      serviceAccountName: prow-exporter
      containers:
        - name: prow-exporter
          image: quay.io/xrstf/prow_exporter:latest
          imagePullPolicy: Always
          args:
            - -namespace=$(POD_NAMESPACE)
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - name: metrics
              containerPort: 9855
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /metrics
              port: metrics
          readinessProbe:
            httpGet:
              path: /metrics
              port: metrics
          resources:
            requests:
              cpu: 100m
              memory: 1Gi
            limits:
              cpu: 1
              memory: 2Gi
          securityContext:
            runAsNonRoot: true
            runAsUser: 65534
