When using helm chart to deploy a prefect worker, ...
# prefect-kubernetes
s
When using helm chart to deploy a prefect worker, is there a way to specify the namespace that jobs will be created in? Or do we have to manually configure it with the user interface?
t
I believe josbs will run in the same namespace as workers
s
Yes, and this is our particular issue. We deploy working in non-default namespace, but when worker registers to the prefect server as a new worker pool, the configuration uses default namespace, and will be creating jobs in default space (and runs into permission issue), therefore, we need to go to the prefect UI and manually update the namespace to be the same one that worker is deployed in.
j
Hi @schwannden kuo ! You can set the namespace jobs should be created in on the workpool settings.
s
Yes I am aware that we can do so in prefect UI, but is there a way to do so in helm chart? So that we don't need to manually go on UI to change it? I found https://github.com/PrefectHQ/prefect/issues/9845 already, seems like other people is having the same issue. Perhaps I'll create pr to add this option
j
yep! you can set the base job template on the worker and in doing so, set the namespace! https://github.com/PrefectHQ/prefect-helm/blob/main/charts/prefect-worker/README.md#configuring-a-base-job-template-on-the-worker
this will only work if the workpool does not already exist though
s
this is nice! thx for the tips