apiVersion: apps/v1
kind: Deployment
metadata:
  name: "harbor-jobservice"
  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.15.0"
    component: jobservice
    app.kubernetes.io/component: jobservice
spec:
  replicas: 2
  revisionHistoryLimit: 10
  strategy:
    type: Recreate
    rollingUpdate: null
  selector:
    matchLabels:
      release: harbor
      app: "harbor"
      component: jobservice
  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.15.0"
        component: jobservice
        app.kubernetes.io/component: jobservice
      annotations:
        checksum/configmap: c2e3acfc6b31142f56cc1bd707f88de87d958699fa1e249938969caacea88422
        checksum/configmap-env: 0e296f95cba8dcfaade3244867012fda805351519d0b7e05982b482304838439
        checksum/secret: 388df16a5ce670284aaa57126ada65df238ddadbad14c5aaa94a384592da2e7d
        checksum/secret-core: 7d184289f51bc7b1001e976c80693ff24befaa3ccfb2146ab9c4051b61ae385d
    spec:
      securityContext:
        runAsUser: 10000
        fsGroup: 10000
      automountServiceAccountToken: false
      terminationGracePeriodSeconds: 120
      containers:
        - name: jobservice
          image: ghcr.io/goharbor/harbor-jobservice:v2.15.1@sha256:0de4fd2ce3a02d3e6591b439e4674ea085885ddf43652b44004cc67eb19dba12
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /api/v1/stats
              scheme: HTTP
              port: 8080
            initialDelaySeconds: 300
            periodSeconds: 10
            timeoutSeconds: 1
            failureThreshold: 3
            successThreshold: 1
          readinessProbe:
            httpGet:
              path: /api/v1/stats
              scheme: HTTP
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 10
            timeoutSeconds: 1
            failureThreshold: 3
            successThreshold: 1
          env:
            - name: CORE_SECRET
              valueFrom:
                secretKeyRef:
                  name: harbor-secret
                  key: secret
            - name: JOBSERVICE_SECRET
              valueFrom:
                secretKeyRef:
                  name: harbor-secret
                  key: JOBSERVICE_SECRET
            - name: REGISTRY_CREDENTIAL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: harbor-secret
                  key: REGISTRY_PASSWD
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            runAsNonRoot: true
            seccompProfile:
              type: RuntimeDefault
          envFrom:
            - configMapRef:
                name: "harbor-jobservice-env"
            - secretRef:
                name: "harbor-jobservice"
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: jobservice-config
              mountPath: /etc/jobservice/config.yml
              subPath: config.yml
            - name: job-logs
              mountPath: /var/log/jobs
              subPath:
      volumes:
        - name: jobservice-config
          configMap:
            name: "harbor-jobservice"
        - name: job-logs
          emptyDir: {}
