Is there a way to mount a default env var with val...
# flyte-support
n
Is there a way to mount a default env var with value as k8s-secret to each task’s pod? I see that I can put default env vars, but I can actually put a secret key directly in env var.
g
are you looking for something like
Copy code
@task(
    secret_requests=[
        Secret(
            group="user-info",
            key="user_secret",
            env_var=Secret.MountEnvVar(name="foo"),
        ),
n
Yeah almost this, but in propeller which is globally injected to each of the task pods
g
that pr will only inject the secret to one pod
a
@nice-market-38632 have you tried with a PodTemplate?
n
Where can we define a PodTemplate? For a single task I understand. I want to inject a secret to all tasks like a global config.
a
@nice-market-38632 you can 1. Create a PodTemplate resource on the namespace where the Flyte backend pods are running (including flytepropeller) a. Here it's important that `template.spec.containers.name`is `default`so Propeller use it as the base for all the containers on each Task Pod. One thing it's not overridable is the `image`but other than that, you could add there the `envFrom`block 2. Set it as a the default PodTemplate in the Helm chart (docs)
👍 1