Hi, does anyone know if the env vars set on the pr...
# ask-community
b
Hi, does anyone know if the env vars set on the prefect agent (deployed in k8s) get injected into a dask cluster automatically? Or do we also have to duplicate them when making the pod spec for dask? Our executor is defined like:
Copy code
flow.executor = DaskExecutor(
    cluster_class=lambda: KubeCluster(
        name=f"dask-{flow_image_name}",
        pod_template=make_pod_spec(
            image=prefect.context.image,
            cpu_request=worker_cpu,
            memory_request=worker_mem,
            threads_per_worker=threads_per_worker
        )
    ),
    adapt_kwargs={
        "minimum": min_workers,
        "maximum": max_workers
    },
)
k
Hey @Brad I, are you on server or cloud?
b
Hi @Kevin Kho, we’re using the cloud plus an agent in our GKE cluster
k
I went through the code and I don’t think they are injected. What env variables these?
b
I’m talking about any env vars that are found when you run a flow, under ‘Advanced’ -> ‘Environment Variables’. We set a few of them when we register our flows, but now are trying to move from
LocalDaskExecutor
to the
DaskExecutor
.
k
So env vars are not carried over but Prefect specific env vars are carried over through the context.
b
ok, thanks