Skip to content

Plan fails when trying to migrate to helm v3.2.0 #1874

Description

@mkmumbai

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: > 1.15.8
Provider version: 3.2.0 
Kubernetes version: 1.35

Affected Resource(s)

  • helm_release

Terraform Configuration Files

module "karpenter_eks_blueprints_addon" {
  source  = "(https://registry.terraform.io/modules/aws-ia/eks-blueprints-addons/aws/1.24.3)"
  version = "1.24.3"

  cluster_name      = module.eks.cluster_name
  cluster_endpoint  = module.eks.cluster_endpoint
  cluster_version   = module.eks.cluster_version
  oidc_provider_arn = module.eks.oidc_provider_arn

  enable_karpenter = true

  create_delay_dependencies = [for prof in module.eks.fargate_profiles : prof.fargate_profile_arn]

  karpenter_node = {
    iam_role_use_name_prefix = false
    iam_role_additional_policies = {
      AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
      ECRPullThroughCachePolicy    = aws_iam_policy.ecr-pull-through-cache.arn,
    }
  }

  # wait true condition is needed as karpenter_provisioner and karpenter_node_template are applied immediately after karpenter addon installation.
  # This can removed once karpenter 0.33 version is available via tf module and this module addon is merged with other addons.
  karpenter = {
    repository       = var.helm_mirror_repo
    create_namespace = false
    namespace        = "karpenter"
    chart            = "karpenter"
    chart_version    = local.versions.charts.karpenter
    description      = local.karpenter_dependency_hash
    values = [
      <<-EOT
      settings:
        featureGates:
          spotToSpotConsolidation: ${contains(["beta", "prd"], var.stage) ? false : true}
      replicas: ${var.stage == "dev" ? 1 : 2}
      controller:
        image:
          repository: prd/public.ecr.aws/karpenter/controller
        resources: ${jsonencode(merge(local.karpenter_default_resources, var.karpenter_resources))}
      strategy:
        rollingUpdate:
          maxUnavailable: "25%"
          maxSurge: "25%"
      additionalLabels: ${jsonencode(merge(local.dp_healthcheck_custom_labels.addons, local.dp_healthcheck_custom_labels.monitoring_priority_critical))}
      podLabels: ${jsonencode(local.fargate_label)}
      dnsPolicy: Default
      EOT
    ]
    wait = true
  }

  # This module does not require any explicit dependencies to be added via "depends_on".
  # All dependencies should be managed within the `karpenter_dependencies` (see the locals block above).
}

Debug Output

NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm.

Panic Output

Steps to Reproduce

  1. Have an existing Helm release resource on a version earlier than v3.0
  2. Update the terrafom code to use Helm provider version 3.0 or later
  3. Run terraform plan and the plan fails with the error.

Expected Behavior

Terraform plan and apply runs successfully.

Actual Behavior

Terraform plan fails with the error below; the same error is thrown for every helm_release resource.

Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/hashicorp/helm" planned an invalid value
│ for
│ module.karpenter_eks_blueprints_addon.module.karpenter.helm_release.this[0].description:
│ planned value cty.NullVal(cty.String) does not match config value
│ cty.UnknownVal(cty.String).
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Important Factoids

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions