https://dagster.io/ logo
#ask-ai
Title
# ask-ai
l

lorenzo tenti

03/06/2024, 4:34 PM
Using Helm deployments, how can I set an env variable that will be available both in the webserver and in the user deployments?
s

Scout

03/06/2024, 4:34 PM
When using Helm to deploy Dagster, you can set environment variables that will be available in both the webserver and the user deployments by specifying them in the Helm chart values. The environment variables can be defined under the appropriate sections for the webserver and user deployments. For the webserver, you would typically set environment variables under the
dagit
section of the Helm chart values. For user deployments, you would set them under the
deployments
section. Each user deployment can have its own set of environment variables defined. Here's a general approach to setting environment variables for both the webserver and user deployments in your
values.yaml
file:
Copy code
yaml
dagit:
  # ... other Dagit configuration ...
  env:
    MY_ENV_VAR: "my-value"

deployments:
  - name: my_user_deployment
    # ... other user deployment configuration ...
    env:
      MY_ENV_VAR: "my-value"
In this example,
MY_ENV_VAR
is the environment variable you want to set, and
"my-value"
is the value you want to assign to it. This variable will be available in both the webserver (Dagit) and the specified user deployment. Please note that if you have multiple user deployments and you want the same environment variable to be available in all of them, you would need to repeat the
env
block with the environment variable under each user deployment definition. Remember to apply your Helm chart changes with
helm upgrade
to update your Dagster deployment with the new environment variable settings. For more specific details on how to configure environment variables for your particular setup, you should refer to the Dagster Helm chart documentation and the values schema provided with the chart. Using environment variables and secrets ... button Env vars in user code deployment pods sh... button How do I set variables for jobs as for u... button How do I set per-code-location deploymen... button Thank you for your feedback!
l

lorenzo tenti

03/06/2024, 4:35 PM
So I need to define them twice
12 Views