https://dagster.io/ logo
#ask-community
Title
# ask-community
a

Andy Clegg

03/01/2024, 3:58 PM
I'm using
execute_k8s_job
within an
@op
so that I can run my existing workload image; this image requires specific environment variables to be set to define the work. For example, I might want to spawn one pod with
ALPHA=0.1
, another with
ALPHA=0.25
etc. The
env_vars
argument of
execute_k8s_job
seems to only pass-through existing variables set at the deployment level. Is there any way to pass arbitrary environment variables and values to a K8S job? Thanks!
i

Ismael Rodrigues

03/01/2024, 5:14 PM
Try asking on #deployment-kubernetes also
a

Andy Clegg

03/01/2024, 5:16 PM
Thanks @Ismael Rodrigues. I actually just found a solution - add
container_config={'env': [ {'name': 'ALPHA', 'value': '0.25'}]}
to the
execute_k8s_job
call. I also added
merge_behavior=K8sConfigMergeBehavior.DEEP
but this may not be necessary.
daggy love 1
3 Views