Gene Yang
06/21/2023, 12:06 AM"job_configuration": {
"env": "{{ env }}",
"name": "{{ name }}",
"labels": "{{ labels }}",
"command": "{{ command }}",
"namespace": "{{ namespace }}",
"job_manifest": {
"kind": "Job",
"spec": {
"template": {
"spec": {
"containers": [
{
"env": "{{ env }}",
"args": "{{ command }}",
"name": "prefect-job",
"image": "{{ image }}",
"imagePullPolicy": "{{ image_pull_policy }}"
}
],
"completions": 1,
"parallelism": 1,
"restartPolicy": "Never",
"imagePullSecrets": [
{
"name": "git-registry-token"
}
],
"serviceAccountName": "{{ service_account_name }}"
}
},
"ttlSecondsAfterFinished": "{{ finished_job_ttl }}"
},
"metadata": {
"labels": "{{ labels }}",
"namespace": "{{ namespace }}",
"generateName": "{{ name }}-"
},
"apiVersion": "batch/v1"
},
"stream_output": "{{ stream_output }}",
"cluster_config": "{{ cluster_config }}",
"job_watch_timeout_seconds": "{{ job_watch_timeout_seconds }}",
"pod_watch_timeout_seconds": "{{ pod_watch_timeout_seconds }}"
}
Here I am adding the imagePullSecrets attribute so that the kubernetes job can pull the custom built runner image; however, I have to go into the UI and add this through the advanced config. Is there any clean way to do this via the CLI, or by editing the deployment.yaml/prefect.yaml? I thought about creating my own worker with its own base job template by subclassing the default kubenetes worker, but I would rather not add unnecessary complexity to my project!
Thanks so much!