https://dagster.io/ logo
#dagster-support
Title
# dagster-support
s

Scott Hood

05/05/2022, 2:41 PM
Hey Team, this might be more of a helm question. I noticed that in the user deployments there is a shared config map created called ``<name>-user-deployments-shared-env` can anyone give examples of how one would append to this in order to establish common environment variables? Wasn't seeing anything in the documentation of how to do this let alone it even being a thing.
d

daniel

05/05/2022, 2:48 PM
I don't think we have a hook for adding these to all user code deployments, but we do have one for setting env vars for individual deployments: https://github.com/dagster-io/dagster/blob/master/helm/dagster/charts/dagster-user-deployments/values.yaml#L73-L82
s

Scott Hood

05/05/2022, 2:51 PM
Yep! I saw this one, I have already currently built out a config map and applied to our first deployment, however after seeing that there was a config map being created wondering if I can abstract that process away by appending onto the one user deployments creates. Also simply curious about how one adds to config maps if say for example you have secrets being pulled from external secret managers.
d

daniel

05/05/2022, 2:54 PM
the
env:
field that i linked also makes a config map for you (it's just scoped to the individual deployment rather than shared across all of them).
s

Scott Hood

05/05/2022, 2:56 PM
Yep which generates this guy:
<chatname>-<deploymetn-name>-user-env
Problem with this is we will have multiple deployments and have a set of common environment variables that we want applied to each so either we have to create a config map once, apply it to every deployment, or like you have here, apply the environment variables to each deployment.
d

daniel

05/05/2022, 3:00 PM
I'll file an issue for that, seems like a very reasonable request
@Dagster Bot issue in the Helm chart, allow a way to set shared environment variables that apply to all user code deployments
d

Dagster Bot

05/05/2022, 3:01 PM
s

Scott Hood

05/05/2022, 3:01 PM
I think I found this: https://github.com/dagster-io/dagster/commit/9941f61fabf574871e4896c5cbb1a7c21c1ed9f3 Which indicates that the value might be
dagsterUserDeployments.sharedEnv
for setting the global confits.
d

daniel

05/05/2022, 3:02 PM
dagsterUserDeployments.sharedEnv
is an internal function for our helm chart - it's not something that we expose directly in the values.yaml unfortunately
for now i think the best workaround we have is to create your own configmap with the shared env vars you want, and reference that configmap in the envConfigMaps for each of your deployments
s

Scott Hood

05/05/2022, 3:52 PM
Sounds good, thanks!
Hey @daniel does Dagsters env variable take in secrets normally? We are trying to set
AzureKeyVaultSecret
to the env list via:
Copy code
env:
            - name: AUTH_TOKEN
              valueFrom:
                secretKeyRef:
                  name: <secret_name>
                  key: <dataKey>
However was apparently running into errors. Our AKS group is saying to simply set the
envSecrets
however not sure based on that how its supposed to route the dataKey to the correct Environment variable name.
d

daniel

05/05/2022, 6:32 PM
I think you want envSecrets, yeah. That will mount all the env vars in that secret like in the secretRef example here: https://kubernetes.io/docs/concepts/configuration/secret/#use-case-as-container-environment-variables
it assumes the keys in the secret data are the same as the env var names
s

Scott Hood

05/05/2022, 6:33 PM
Does it turn the dataKey into proper env format? or does it just take the name straight up?
d

daniel

05/05/2022, 6:34 PM
what do you mean exactly by proper env format?
UPPER_CASE_WITH_UNDERSCORES?
(it just takes the name straight up, to answer your question)
s

Scott Hood

05/05/2022, 6:36 PM
Ok I see, so just make the dataKey the value of the env.
d

daniel

05/05/2022, 6:37 PM
Yeah - the key is the env var name and the value is the env var value
3 Views