Hi everyone I am in the process of migrating from ...
# prefect-kubernetes
f
Hi everyone I am in the process of migrating from prefect 2.11 to 2.19, and as part of that, upgrading from a Prefect Agent to a Worker. I have deployed my worker on Kubernetes, and the
baseJobTemplate.json
for it is saved as config map which gets mounted into the worker's pod. The first deployment was smooth however I noticed any subsequent change that I make to the
baseJobTemplate.json
in the ConfigMap does not get applied in the prefect worker or the Prefect UI. For example, I changed the default value for
env
to include a pip package to be installed. I confirmed that the value is updated in the configmap, however, I could not see the updated env value in the Prefect UI under the respective
Work Pool
.
I tried deleting the deployments and re-applying and still no success. It was only after manually deleting the work pool in the Prefect UI that the changes got reflected i.e.
Environment Variables
value got update in the work pool's
Base Job Configuration
(see the highlighted text in the attached screenshot). Is this the expected behaviour? or am I missing something? Happy to send my kubernetes deployment and configmap if that helps.
I just looked into the
prefect  worker start --help
and noticed this:
--base-job-template >> The path to a JSON file containing the base job template to use. 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.
I guess that answers that my question, however I wonder if there is any other way to handle this so that changes like this to the configuration could be applied on worker-level without having to delete the workpool manually from the Prefect UI?
k
the template that gets read at deployment runtime is ultimately in the work pool server-side. that template file's only purpose is to decide what the initial template sent to the server to create the work pool looks like. so the thing that needs to be updated is the work pool, accessed through the UI, API, or update_work_pool client method