What is the best way to deal with env vars for kube workers? Should we handle that in our Dockerfile, or is there a programmatic way of sending env vars to the execution pods?
09/18/2023, 4:37 PM
You’ve got a number of options or getting environment variables with kubernetes deployments. Here are a few:
1. You could store the values in Prefect Variables or Prefect Secret blocks and refer to them in your Python flow code.
2. Same as #1 but refer to them in your prefect.yaml file build step when you create your deployment.
3. Put them in your Dockerfile directly.
4. Specify them when you create your Workpools in the Base Job Template’s Environment Variables field (screenshot below).