https://prefect.io logo
#prefect-community
Title
# prefect-community
c

Cab Maddux

03/11/2020, 6:18 PM
Hi! When having the Kubernetes Agent trigger flows, I haven't been able to have the agent create my job with a custom k8s config yaml (it creates the job, just with the default k8s config yaml). Shouldn't I be able to use
flow.environment = KubernetesJobEnvironment(job_spec_file='...')
prior to
flow.register()
and have the k8s agent use my
job_spec_file
to create the job? My job spec file is basically just the example here: https://docs.prefect.io/cloud/execution/k8s_job_environment.html#examples
Actually it looks like the Kubernetes agent is creating a k8s job which is then creating another k8s job using my yaml to run the flow which seems kind of odd. Is there a way I can just have the k8s agent create a prefect job with a custom yaml?
z

Zachary Hughes

03/11/2020, 7:32 PM
Hi Cab, it looks like that's not currently possible. As it stands right now, we need to retrieve the flow from storage before we know what YAML the flow needs. We do have an issue open for this-- feel free to chime in with your use case and that could help us prioritize. https://github.com/PrefectHQ/prefect/issues/1658