How to mount a volume to a KubernetesJob infrastr...
# prefect-community
Is it possible to add a volumeMount via json patches in prefect 2? I keep running into path error, when i look at the kubernetes job source code the shortcut for env looks like:
"path": "/spec/template/spec/containers/0/env/-"
Which means the path for the volume mount should be:
"path": "/spec/template/spec/containers/0/volumeMounts/-"
When i use that path it doesn't work, any ideas?
👀 1
@Emil Christensen I am still having issues with this. I tried a few combinations and it still doesn't work.
👀 1
@Anna Geller would you have any examples of volumeMount, i didn't see any on discourse
how would you do that in a KubernetesJob template? those customizations are essentially a patch to modify/add things to a Kubernetes YAML manifest
A volumeMount looks like:
Copy code
  - image: <|>
    name: test-container
    - mountPath: /test-ebs
      name: test-volume
so I think a patch might look like:
Copy code
gratitude thank you 2
Copy code
p='[{"op": "replace", "path": "/spec/template/spec/containers/0/volumeMounts", "value": [{"mountPath": "/test-ebs", "name": "test-volume"}]}]'
@Christopher Boyd thanks for the help there! I had make a minor change for EKS Fargate (used add instead of replace), but other than that it did the trick.
🙌 1