https://flyte.org logo
#ask-the-community
Title
# ask-the-community
n

Nuno Martins

06/20/2023, 1:52 PM
Hello, I'm trying to pass certain variables to my Flyte workers (for example, data warehouse credentials, among others). I need to pass these variables as environment variables to my workflows. How can I achieve this? Can't figure it out from the documentation. Thanks
k

Ketan (kumare3)

06/20/2023, 1:55 PM
We prefer that you use secrets. Env variables can be passed to but that is not secure
k

Kevin Su

06/20/2023, 3:35 PM
you can use
pyflyte run --env …
n

Nuno Martins

06/21/2023, 2:56 PM
Thanks for the help. I created secrets with:
kubectl create secret -n <project>-<domain> <secret-name> --from-literal=<KEY1>=<VAL1> --from-literal=<KEY2>=<VAL2>
. Using
kubectl get -n <project>-<domain> secrets/<secret-name>
I can see the secret was created successfully with the correct values. But upon including them on my task, e.g. :
Copy code
@task(secret_requests=[Secret(group=<secret-name>, key=<KEY1>)])
def task1...
i get a
max number of system retry attempts [11/10] exausted...
, am I doing something incorrect here?
k

Kevin Su

06/21/2023, 8:05 PM
do you see any other error from the pod?
n

Nuno Martins

06/22/2023, 8:23 AM
I think the pod does not even launch in the first place.