kind: CronJob
apiVersion: batch/v1beta1
metadata:
  name: pastebin-collector-job
spec:
  schedule: "@daily"
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: pastebin-collector-job
        spec:
          restartPolicy: OnFailure
          volumes:
            - name: malware-mount
              nfs:
                server: 192.168.1.29
                path: /mnt/DroboFS/Shares/malware/pastebin-extractions
            - name: pastebin-mount
              nfs:
                server: 192.168.1.29
                path: /mnt/DroboFS/Shares/paste
          containers:
            - name: pastebin-collector
              image: gclef/pastebin:pastebin-collector-1.17
              imagePullPolicy: "Always"
              resources:
                limits:
                  memory: "1Gi"
                requests:
                  memory: "512Mi"
              volumeMounts:
                - name: malware-mount
                  mountPath: /malware
                - name: pastebin-mount
                  mountPath: /paste
              env:
                - name: PASTEBIN_PATH
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: PASTEBIN_PATH
                - name: MALWARE_PATH
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: MALWARE_PATH
                - name: ANALYZER_PATH
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: ANALYZER_PATH
                - name: ANALYZER_URL
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: ANALYZER_URL
                - name: ANALYZER_TOKEN
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: ANALYZER_TOKEN
                - name: ARCHIVE_PASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: pastebincollector-secrets
                      key: ARCHIVE_PASSWORD
          imagePullSecrets:
            - name: registrycreds