-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Summary
I've noticed that lately we've gotten more questions about how to use base job templates, including:
- How to expose more environment variables
- How to expose environment variables from secrets
- How to set image pull secrets
Let's expand our docs a little to make usage more clear.
What we have so far:
prefect-helm/charts/prefect-worker/README.md.gotmpl
Lines 244 to 250 in 3acdb38
#### Updating the Base Job Template If a base job template is set through Helm (via either `.Values.worker.config.baseJobTemplate.configuration` or `.Values.worker.config.baseJobTemplate.existingConfigMapName`), we'll run an optional `initContainer` that will sync the template configuration to the work pool named in `.Values.worker.config.workPool`. Any time the base job template is updated, the subsequent `initContainer` run will run `prefect work-pool update <work-pool-name> --base-job-template <template-json>` and sync this template to the API. Please note that configuring the template via `baseJobTemplate.existingConfigMapName` will require a manual restart of the `prefect-worker` Deployment in order to kick off the `initContainer` - alternatively, you can use a tool like [reloader](https://github.com/stakater/Reloader) to automatically restart an associated Deployment. However, configuring the template via `baseJobTemplate.configuration` value will automatically roll the Deployment on any update. prefect-helm/charts/prefect-worker/values.yaml
Lines 113 to 128 in 3acdb38
## If unspecified, Prefect will use the default base job template for the given worker type. If the work pool already exists, this will be ignored. ## e.g.: ## baseJobTemplate: ## configuration: | ## { ## "variables": { ## ... ## }, ## "job_configuration": { ## ... ## } ## } ## OR ## baseJobTemplate: ## existingConfigMapName: "my-existing-config-map" baseJobTemplate: