Hi all! Does anyone have an example of how they've...
# deployment-kubernetes
a
Hi all! Does anyone have an example of how they've been able to use the Terraform helm provider to set map type values in the Dagster Kubernetes YAML? For example, I am trying to set environment variables for my user deployment on the element
dagster-user-deployments.deployments[0].env
If I pass a raw Terraform object then I get an error stating that a string is expected. If I pass a string via wrapping my object with
yamlencode
then I get an error from helm stating that an object is expected.
d
I actually just ran into this today. I wrapped mine in a string literal to get it all to play together nicely. Like so:
Copy code
resource "helm_release" "user_deployment" {
  name       = "dagster-code"
  version    = var.dagster_version
  repository = "<https://dagster-io.github.io/helm>"
  chart      = "dagster-user-deployments"
  values = [
    <<EOT
deployments:
  - name: "dagster-pipelines"
    image:
      repository: "${var.registry.location}-docker.pkg.dev/${var.registry.project}/${var.registry.repository_id}/${var.dagster_deployment_image}"
      tag: "${var.dagster_deployment_tag}"
      pullPolicy: Always
    dagsterApiGrpcArgs:
    ...
EOT
  ]
1
a
Thanks! I'm actually introducing a separate yaml file in the values portion as follows:
Copy code
resource "helm_release" "dagster_release" {
  name       = "dagster-release-${var.resource_tag}"

  repository = "<https://dagster-io.github.io/helm>"
  chart      = "dagster"
  namespace = "default"
  version = "0.13.9" # TODO Make a top-level var and pass down

  values = [
      "${file("${path.module}/resources/dagster/values.yaml")}"
  ]
}
But I think found the mistake I was making. I was trying to set all values in the
dagster-user-deployments.deployments[0].env
element with one
set
block in my configuration when I should actually be using a separate set block for each key in the map.