Christine Chen
08/02/2023, 11:45 PMHenning Holgersen
08/03/2023, 7:30 AMChristine Chen
08/03/2023, 8:17 PMHenning Holgersen
08/04/2023, 6:58 AMChristine Chen
08/04/2023, 3:19 PMHenning Holgersen
08/04/2023, 3:30 PMredsquare
08/04/2023, 3:40 PM"volumeMounts": [{
"mountPath": "/logs",
"name": "logs-data"
}]
Christopher Boyd
08/04/2023, 3:50 PMvolumeMounts:
- name: nfs-vol
mountPath: /var/nfs # The mountpoint inside the container
volumes:
- name: nfs-vol
nfs:
server: 192.168.200.90 # IP to our NFS server
path: /nfs # The exported directory
Christine Chen
08/04/2023, 7:37 PMHenning Holgersen
08/04/2023, 8:07 PMChristine Chen
08/04/2023, 8:10 PMimport yaml
from prefect.infrastructure import KubernetesJob
with open("k8s-job.yaml", "r") as job_config:
job_manifest = yaml.safe_load(job_config)
k8s_job = KubernetesJob(
image=<image>,
image_pull_policy="Always",
pod_watch_timeout_seconds=600,
finished_job_ttl=300,
job=job_manifest,
)
k8s_job.save("k8s-flow", overwrite=True)
apiVersion: batch/v1
kind: Job
metadata:
labels: {}
spec:
template:
spec:
parallelism: 1
completions: 1
restartPolicy: Never
containers:
- name: prefect-job
env: []
volumeMounts:
- mountPath: <mount-path>
name: <volume-name>
volumes:
- name: <volume-name>
persistentVolumeClaim:
claimName: <claim-name>