rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
263 stars 228 forks source link

[BUG] rancher2_app_v2 values not passed to subcharts #1418

Open SwitchTV-BenBettridge opened 1 month ago

SwitchTV-BenBettridge commented 1 month ago

Rancher Server Setup

Information about the Cluster

User Information

Provider Information

Describe the bug

When installing the rancher-monitoring chart via the rancher2_app_v2 resource, values for subcharts are not recognised.

Terraform Code:

locals {
  monitoring_chart_values = <<-EOS
  alertmanager:                                                                                                                                                                                                                     
    alertmanagerSpec:
      storage:
        volumeClaimTemplate:
          spec:
            accessModes: ["ReadWriteOnce"]
            resources:
              requests:
                storage: 10Gi
    EOS
  cluster_id = "<CLUSTER_ID>"
  rancher_monitoring_chart_version = "104.1.0+up57.0.3"
}

resource "rancher2_app_v2" "rancher_monitoring" {
  cluster_id = local.rancher_cluster_id
  name = "rancher-monitoring"
  namespace = "cattle-monitoring-system"
  repo_name = "rancher-charts"
  chart_name = "rancher-monitoring"
  chart_version = local.rancher_monitoring_chart_version
  values = local.monitoring_chart_values 
}

output "values" {
  value = local.monitoring_chart_values
}

To Reproduce

Deploy the above to a rancher cluster after replacing <CLUSTER_ID> with an actual cluster ID.

Then check the Values YAML in Rancher or Helm to verify the settings are set.

Actual Result

Storage settings are not applied:

alertmanager:
  alertmanagerSpec:
<snip...>
    storage: {}
<snip...>

Expected Result

Values specified for alertmanager are passed through to the alertmanager chart

Additional Notes

We originally deployed this instance using the helm_release resource, and later imported it as a rancher2_app_v2