apiVersion: batch/v1
kind: Job
metadata:
  name: prefect-job
  labels: {}
spec:
  template:
    metadata:
      labels: {}
    spec:
      containers:
        - name: flow
          image: prefecthq/prefect:latest
          imagePullPolicy: IfNotPresent
          env:
            - name: PREFECT_ES_URL
              value: "https://malwaretl-cluster-es-http.es.svc.cluster.local"
            - name: PREFECT_ES_USER
              valueFrom:
                secretKeyRef:
                  name: prefect-secrets
                  key: es-user
            - name: PREFECT_ES_PASS
              valueFrom:
                secretKeyRef:
                  name: prefect-secrets
                  key: es-pass
          resources:
            requests:
              cpu: "200m"
            limits:
              cpu: "500m"
          volumeMounts:
            - name: malware
              mountPath: /malware
              readOnly: True
            - name: results
              mountPath: /results
            - name: tireports
              mountPath: /tireports
            - name: pastebin
              mountPath: /pastebin
            - name: mlexamples
              mountPath: /mlexamples
      restartPolicy: Never
      imagePullSecrets:
        - name: ""
      volumes:
        - name: malware
          persistentVolumeClaim:
            claimName: prefect-raw-malware-pvc
        - name: results
          persistentVolumeClaim:
            claimName: prefect-analysis-results-pvc
        - name: tireports
          persistentVolumeClaim:
            claimName: prefect-ti-report-pvc
        - name: pastebin
          persistentVolumeClaim:
            claimName: prefect-pastebin-pvc
        - name: mlexamples
          persistentVolumeClaim:
            claimName: prefect-ml-examples-pvc