https://prefect.io logo
Title
m

Matt Allen

07/17/2020, 4:46 PM
Is there a way to specify that the kubernetes agent should set certain environment variables (particularly from a kube secret) in the pods that it creates?
I tried starting it with the
-e
option but that didn't seem to transfer to the pods that it starts
Actually I think I figured this out, nvm
🚀 3
p

Philip Bennett

09/01/2020, 1:57 PM
Hey Matt. Did you sort this out? I'm having similar problems where I set the environment variables using --env but I can't seem to access them from within the flow running on a Kubernetes agent I'm running my agent using
prefect agent install kubernetes --api "<http://10.154.15.199:4200>" --rbac --resource-manager --env DB_HOST=10.104.145.11 --env CRUNCHBASE_API_KEY=XYZ | kubectl apply -f -
m

Matt Allen

09/01/2020, 4:24 PM
Unfortunately I've moved away from this configuration method so I don't remember what I had to do to get it working, I think it was something related to the
PREFECT__
prefix on the environment variables
p

Philip Bennett

09/02/2020, 8:14 AM
Hey Matt. Thanks for your response. I logged it with Chris W and he's applied a fix. 🙂