kind: Job
apiVersion: batch/v1
metadata:
  name: prefect-db-setup
spec:
  template:
    spec:
      restartPolicy: OnFailure
      containers:
        - name: prefect-setup-container
          image: gclef/malwaretl-prefect-setup:0.11
          imagePullPolicy: "IfNotPresent"
          resources:
            limits:
              memory: "1Gi"
            requests:
              memory: "1Gi"
          env:
            - name: ELASTIC_USER
              value: "elastic"
            - name: ELASTIC_PASS
              valueFrom:
                secretKeyRef:
                  name: malwaretl-cluster-es-elastic-user
                  key: elastic
            - name: PREFECT_ES_USER
              valueFrom:
                secretKeyRef:
                  name: prefect-secrets
                  key: es-user
            - name: PREFECT_ES_PASS
              valueFrom:
                secretKeyRef:
                  name: prefect-secrets
                  key: es-pass
      imagePullSecrets:
        - name: registrycreds
