hi everyone, I'm really excited to start using Fly...
# flyte-support
e
hi everyone, I'm really excited to start using Flyte! I have a question and I can't figure out the simplest and cleanest way to handle it. My tasks will need some environment variables, including API keys and other settings. I’ll need these variables both in the sandbox/demo environment and in staging/production. What’s the best way to make these variables available to tasks? Outside of Flyte, I usually use a
.env
file locally and a ConfigMap in Kubernetes for production. Thanks a lot in advance! 🙏
g
https://docs.flyte.org/en/latest/user_guide/productionizing/secrets.html for API keys and other sensitive information. Locally, you'll use be able to use envvars to access them (so you'll need to load your .env into the environment)
e
thank you @gentle-tomato-480. I'm doing it that way, but it's tedious to specify all the variables one by one.
a
another way would be to resort to our good ol' friend: the PodTemplate. Depending on how's your infrastructure configured, you could have that PodTemplate available both to your demo and prod environments and there mount the envVars from a configmap as usual. There are different levels at which you can set the template (ref)