Hi everyone. Need some help with custom K8s Job T...
# ask-community
a
Hi everyone. Need some help with custom K8s Job Template. We need one of the PVCs to be accessible for a Flow run. I provided (what I thought a reasonable job template). And currently I get a behavior that looks like Job starts and exits immediately.
template looks like this:
Copy code
apiVersion: batch/v1
kind: Job
spec:
  template:
    spec:
      containers:
      - name: flow
        volumeMounts:
        - mountPath: /notebooks/ceph-data
          name: ceph-data
      volumes:
      - name: ceph-data
        persistentVolumeClaim:
          claimName: ceph-data
Debugging is hard because everything happens so quickly that I have no time to inspect Job and Pod, it starts, exists and resource is deleted.
k
Hi Andrey, I’ll look into this tomorrow
Does your Flow fail? What do you see in the logs? Just making sure the PVC is the issue
a
Sorry, it seems, that the problem was, in our extra fields (we were panicing and adding more stuff to template):
Copy code
apiVersion: batch/v1
kind: Job
spec:
  template:
    spec:
      containers:
      - name: flow
        command:
        - /bin/sh
        - -c
        args:
        - prefect
        - execute
        - flow-run
        volumeMounts:
        - mountPath: /notebooks/ceph-data
          name: ceph-data
        resources:
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: 100m
            memory: 2Gi
      volumes:
      - name: ceph-data
        persistentVolumeClaim:
          claimName: ceph-data
it seems that addition of
command
and
args
broke everything
k
Ah ok thanks for the info! I assume this is still not working right? I can look into that
command
and
args
. Is there something stopping you from using the base Prefect image if this is your command?
a
@Kevin Kho sorry for delayed response After we dropped
command
and
args
it started to work.
k
Ah ok. Thanks for circling back