Dan Morris
09/27/2024, 10:29 AMMarvin
09/27/2024, 10:29 AMDan Morris
09/27/2024, 10:29 AMMarvin
09/27/2024, 10:30 AMnodeSelector
to ensure the worker starts in a specific node in your values.yaml
, you will typically need to modify the Kubernetes job manifest template used by Prefect.
Below is a basic example of how you might adjust your values.yaml
to include a nodeSelector
for the Kubernetes worker.
yaml
# values.yaml
worker:
kubernetes:
job:
template:
apiVersion: batch/v1
kind: Job
metadata:
labels: "{{ labels }}"
namespace: "{{ namespace }}"
generateName: "{{ name }}-"
spec:
ttlSecondsAfterFinished: "{{ finished_job_ttl }}"
template:
spec:
nodeSelector:
<key>: <value> # Replace with your specific node selector
parallelism: 1
completions: 1
restartPolicy: Never
serviceAccountName: "{{ service_account_name }}"
containers:
- ...
Make sure to replace <key>
and <value>
with the specific labels that you use to target nodes.
For further details, you should review Prefect Kubernetes Worker Documentation and the Kubernetes Job Manifest section.
If you encounter any specific issues or have further questions, feel free to ask!