Fabio Machado
09/16/2024, 5:40 PMMarvin
09/16/2024, 5:40 PMprefect.yaml
infrastructure block. I'll check the Prefect 3.x documentation and any related GitHub issues just to be sure.
One moment!
Seems like there might be an issue with setting Kubernetes tolerations directly in the prefect.yaml
file. The GitHub issue I found indicates that sometimes infrastructure settings are not respected unless set through infra_overrides
.
Here's a workaround you can try:
1. Define your KubernetesJob in a deployment script:
python
from prefect.deployments import Deployment
from prefect.infrastructure.kubernetes import KubernetesJob
from your_flow_file import your_flow
job = KubernetesJob(tolerations=[{"key": "key", "operator": "Exists"}]) # Adjust your tolerations here
deployment = Deployment.build_from_flow(
flow=your_flow,
name="your_deployment_name",
infrastructure=job,
infra_overrides={"tolerations": [{"key": "key", "operator": "Exists"}]} # This ensures it gets picked up
)
if __name__ == "__main__":
deployment.apply()
2. Apply this deployment instead of setting it directly in prefect.yaml
.
Check out this GitHub issue for more context.
For more details, you can refer to the Prefect 3.x documentation on deployment and infrastructure customization once it's accessible.
If you have any more specific details or need another approach, let me know!