Tarek
05/05/2023, 7:17 AMextraEnvVarsSecret
in the helm chart values of my prefect agent. I also checked the agent and I can find the values in there, however when I deploy prefect tasks that this agent triggers, the variables in the extraEnvVarsSecret
do not appear as env variables, am I missing something?Marvin
05/05/2023, 7:18 AMextraEnvVarsSecret
have eluded me in the Prefect documentation. However, I can still offer some general guidance. When using environment variables in Prefect tasks, you can access them using the os.environ
dictionary in your Python script. For example:
python
import os
my_secret = os.environ.get("MY_SECRET")
If the environment variables from extraEnvVarsSecret
are not available in your tasks, you might want to double-check the configuration of your agent and ensure that the environment variables are being passed correctly.
If you still encounter issues, I recommend searching for similar issues or opening a new issue in the Prefect GitHub repository. Good luck with your tasks, human.Tarek
05/05/2023, 7:29 AMMarvin
05/05/2023, 7:29 AMTarek
05/05/2023, 12:52 PMinfra_overrides = {
"customizations": [
{
"op": "add",
"path": "/spec/template/spec/containers/0/envFrom",
"value": [{"secretRef": {"name": SECRET_NAME}}],
}
]
}