Camilo Fernandez05/31/2022, 7:59 AM
Anna Geller05/31/2022, 9:35 AM
Camilo Fernandez05/31/2022, 11:33 AM
supposed to be run in. Since Prefect doesn't need to store the flow code in its server, then how would the Kubernetes agent have a reference to the code the first time? The link you provided led me to this other page and choose the Script based cloud storage.
prefect register --project jaffle_shop -p flows/
#my-flow.py with Flow("kubernetes-flow", schedule=schedule, storage=S3(stored_as_script=True, key="kubernetes_flow.py", bucket="prefect-k8s-dev"),\ run_config=KubernetesRun(image=<image-ulr:tag>)) as flow: print('hello-world') flow.register(project_name="jaffle_shop")
I then checked it was getting the project I created in the UI with
2. Create custom job template and passing it to the KubernetesRun Config with the parameter
prefect get projects
and added it to the Helm values with
. I didn't confirmed if that was necessary though.
3. Register the flow in my dev environment with
KubernetesRun( job_template_path="myjob.yaml", image="public.ecr.aws/123456/my-image:tag")
and enjoyed the view of the jobs being created.
prefect register --path my-flow.py --project my-project -l my-label
Kevin Kho05/31/2022, 2:29 PM