apiVersion: apps/v1
kind: Deployment
metadata:
  name: harbor-exporter
  namespace: "harbor"
  labels:
    heritage: Helm
    release: harbor
    chart: harbor
    app: "harbor"
    app.kubernetes.io/instance: harbor
    app.kubernetes.io/name: harbor
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: harbor
    app.kubernetes.io/version: "2.14.1"
    component: exporter
    app.kubernetes.io/component: exporter
spec:
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      release: harbor
      app: "harbor"
      component: exporter
  template:
    metadata:
      labels:
        heritage: Helm
        release: harbor
        chart: harbor
        app: "harbor"
        app.kubernetes.io/instance: harbor
        app.kubernetes.io/name: harbor
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/part-of: harbor
        app.kubernetes.io/version: "2.14.1"
        component: exporter
        app.kubernetes.io/component: exporter
      annotations:
        checksum/configmap: f419f27c185ed4bb0753753b655c3924c1dc3f909898ac1d692f49be89942fcd
        checksum/secret: 9b7d7b9811e8100b8a6960e9bfec53248561025b235858a581824762fe5b0fdf
    spec:
      securityContext:
        runAsUser: 10000
        fsGroup: 10000
      automountServiceAccountToken: false
      containers:
        - name: exporter
          image: goharbor/harbor-exporter:v2.14.1
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /
              port: 8001
            initialDelaySeconds: 300
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /
              port: 8001
            initialDelaySeconds: 30
            periodSeconds: 10
          args: ["-log-level", "info"]
          envFrom:
            - configMapRef:
                name: "harbor-exporter-env"
            - secretRef:
                name: "harbor-exporter"
          env:
            - name: HARBOR_DATABASE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: harbor-postgresql-18-cluster-app
                  key: password
            - name: HARBOR_ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: harbor-secret
                  key: HARBOR_ADMIN_PASSWORD
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            runAsNonRoot: true
            seccompProfile:
              type: RuntimeDefault
          ports:
            - containerPort: 8001
          volumeMounts:
      volumes:
        - name: config
          secret:
            secretName: "harbor-exporter"
