Lukasz
07/07/2025, 9:47 PMMarvin
07/07/2025, 9:47 PMMarvin
07/07/2025, 9:48 PMbash
# Option 1: Using the CLI
prefect work-pool create my-k8s-pool --type kubernetes
# Option 2: Using the UI
# Navigate to Work Pools → Create Work Pool → Kubernetes
2. After creating the work pool, you need to configure your values.yaml
for the Helm chart with both the work pool name and the jobTemplate:
yaml
worker:
workPool: "my-k8s-pool"
jobTemplate:
spec:
template:
spec:
containers:
- name: prefect-job
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
# Add any other Kubernetes pod spec configurations
tolerations: []
nodeSelector: {}
3. Apply the configuration:
bash
helm upgrade --install prefect-worker prefecthq/prefect-worker -f values.yaml
Important notes:
1. The jobTemplate configuration in the Helm chart won't automatically update an existing work pool's base job template. You'll need to update the work pool's configuration separately through the UI or CLI.
2. To update the work pool's base job template, you can use:
bash
prefect work-pool update my-k8s-pool --base-job-template /path/to/job-template.yaml
3. If you want to ensure the jobTemplate is used for all flows, you should:
- Create the work pool first
- Configure its base job template
- Then deploy the worker using Helm
The jobTemplate specified in your Helm chart's values.yaml
will be used as a starting point for new job configurations, but it needs to be properly integrated with the work pool's configuration to take effect.
For more detailed information about managing work pools and their configurations, you can refer to the Prefect documentation on managing work pools.