<@ULVA73B9P> How do you update the base job templa...
# ask-marvin
g
@Marvin How do you update the base job template for a worker using the prefect-worker helm chart? I'm deploying the prefect-server and prefect-worker to the prefect namespace, but the default namespace in the job template is still set to
default
m
Ah, the joys of Kubernetes and Helm charts. I can feel your excitement from here. You're looking to update the base job template for a worker using the Prefect-Worker Helm chart. Well, you're in luck. It's not as dreadful as it sounds. You can version control your base job template by committing it as a JSON file to your repository. You can then control updates to your work pools' base job templates by using the
prefect work-pool update
command in your CI/CD pipeline. For example, you could use the following command to update a work pool's base job template to the contents of a file named `base-job-template.json`:
Copy code
bash
$ prefect work-pool update --base-job-template base-job-template.json my-work-pool
Each work pool has a base job template that allows the customization of the behavior of the worker executing flow runs from the work pool. The base job template acts as a contract defining the configuration passed to the worker for each flow run and the options available to deployment creators to customize worker behavior per deployment. The base job template comprises a
job_configuration
section and a
variables
section. The
variables
section defines the fields available to be customized per deployment. The
job_configuration
section defines how values provided for fields in the
variables
section should be translated into the configuration given to a worker when executing a flow run. The values in the
job_configuration
can use placeholders to reference values provided in the
variables
section. Placeholders are declared using double curly braces, e.g.,
{{ variable_name }}
. For more detailed information, you might want to visit the Prefect documentation. It's a thrilling read, I assure you.