https://dagster.io/ logo
#deployment-kubernetes
Title
# deployment-kubernetes
m

Michel Rouly

07/29/2021, 3:05 PM
I've run into an interesting edge case with the user deployment Helm chart. Seems like, if you separately deploy the
dagster/dagster
and
dagster/dagster-user-deployments
helm charts, there's no way to set environment variables on pipeline runs from the
dagster-user-deployments
release. You can only influence them via
pipelineRun
in the
dagster
deployment. Which strikes me as odd. What if independent
dagster-user-deployments
require independent environment variable settings?
I'm curious if • anyone else has run into this • this is intentional • I'm doin' it wrong
It's especially odd because
pipelineRun.image
looks like it's the user-deployment image. Feels like this is just a missing feature of the
dagster/dagster-user-deployments
chart, it doesn't fully mirror / implement its own
pipelineRun
.
r

rex

07/29/2021, 3:14 PM
@geri also ran into this - here is a work around that I suggested, and we can consider adding this as first class support:
1/ the run launcher loads the environment variables from a configmap. currently, this configmap is from created from 
.Values.pipelineRun
2/ Instead, we can have each user-code-deployment have a configmap of environment vars (or maybe just one configmap for all the user-code-deployments).
3/ You can specify the name for the configmap, and then add the name of this configmap to the celery run config so that it knows it load from this configmap (rather than the one created by 
.Values.pipelineRun
)
4/ so now you can update the environment variables in the 
dagster-user-deployments
 chart, rather than updating 
.Values.pipelineRun
That should decouple the dependency of 
pipelineRun
 , so that we can finally remove it
👀 1
You can do this setup by adding the configmaps from 2/ in the
extraManifests
section of
dagster-user-deployments
m

Michel Rouly

07/29/2021, 3:15 PM
I was just about to ask that!
Well actually, once the configmap is created using
extraManifests
, where does it get added in step 3/ ?
add the name of this configmap to the celery run config
Is that specified in the pipeline tags?
r

rex

07/29/2021, 3:23 PM
it’s specified in the executor run config, which you can provide as
env_config_maps
m

Michel Rouly

07/29/2021, 3:26 PM
which you can provide as
env_config_maps
wait, what? I didn't know that. the examples on that page are all either YAML via dagit/CLI or in python.
so I can remove all the awkward k8s-specific tagging I've written in my pipeline definitions in python 😅
or, wait, maybe I'm misunderstanding you. you're saying I can set
env_config_maps
as they key in those tags.
that makes more sense.
r

rex

07/29/2021, 3:32 PM
yeah we’re misunderstanding each other a bit. I think you’re overloading the term “tag” a bit - tags are just metadata on the pipeline run, while run configuration allows you to provide parameters into the pipeline before execution
in this case, run configuration is injecting the
env_config_maps
m

Michel Rouly

07/29/2021, 3:34 PM
ahh. I'm assuming this is the
celery_executor
you're saying accepts
env_config_maps
in its run config?
r

rex

07/29/2021, 3:34 PM
yep!
m

Michel Rouly

07/29/2021, 3:35 PM
ok, that's why I was misunderstanding. we've just been using the
multiprocess_executor
so far, so I hadn't seen that config key.
r

rex

07/29/2021, 3:37 PM
Ah i see -
.pipelineRun
was mostly an artifact for configuring the celery executor
m

Michel Rouly

07/29/2021, 3:39 PM
makes sense. even without the celery executor, though, it's a convenient way of passing a
configmap
to a pipeline pod.
for now I think I'll need to just specify env vars in the
dagster/dagster
helm release, which is fine.