Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dependency_update does not work for local charts #1293

Open
igoratencompass opened this issue Nov 16, 2023 · 1 comment
Open

The dependency_update does not work for local charts #1293

igoratencompass opened this issue Nov 16, 2023 · 1 comment
Labels

Comments

@igoratencompass
Copy link

igoratencompass commented Nov 16, 2023

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.5.4
Provider version: 2.11.0
Kubernetes version: 1.25

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "karpenter" {
  count  = try(var.add-ons["karpenter"]["enable"], false) ? 1 : 0

  name              = "karpenter"
  chart             = "kubernetes/helm-charts/karpenter"
  namespace         = "karpenter"
  create_namespace  = true
  atomic            = true
  max_history       = 5
 
  timeout           = 300
  lint              = false
  disable_webhooks  = false
  reuse_values      = false
  reset_values      = false
  force_update      = true
  recreate_pods     = false
  cleanup_on_fail   = false
  skip_crds         = false
  dependency_update = true
}

and the Chart yaml:

apiVersion: v2
name: karpenter
description: A Helm chart for Karpenter Autoscaler

# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
type: application

# The chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.27.5

# Version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: '0.27.5'

dependencies:
  - name: karpenter
    version: v0.27.5
    repository: oci://public.ecr.aws/karpenter

Debug Output

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

Steps to Reproduce

  1. terraform apply

Expected Behavior

When I change the version in the Chart.yaml from 0.27.5 to 0.31.2 for example:

$ git diff
diff --git a/kubernetes/helm-charts/karpenter/Chart.yaml b/kubernetes/helm-charts/karpenter/Chart.yaml
index 221582c..d0140ab 100644
--- a/kubernetes/helm-charts/karpenter/Chart.yaml
+++ b/kubernetes/helm-charts/karpenter/Chart.yaml
@@ -8,16 +8,16 @@ type: application
 
 # The chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
-version: 0.27.5
+version: 0.31.2
 
 # Version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application.
-appVersion: '0.27.5'
+appVersion: '0.31.2'
 
 dependencies:
   - name: karpenter
-    version: v0.27.5
+    version: v0.31.2
     repository: oci://public.ecr.aws/karpenter

I expect terraform to fetch the new chart version this chart depends on.

Actual Behavior

The dependency does not get updated and stays at the current version 0.27.5 after terraform plan + apply:

$ date
Thu 16 Nov 2023 11:41:37 AEDT
$ ls -l kubernetes/helm-charts/karpenter/charts/
total 20
-rw-r--r-- 1 user user 18757 Nov 10 17:01 karpenter-v0.27.5.tgz

Terraform proceeds deploying upon showing the changes in the plan stage:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # helm_release.karpenter[0] will be updated in-place
  ~ resource "helm_release" "karpenter" {
        id                         = "karpenter"
        name                       = "karpenter"
      ~ version                    = "0.27.5" -> "0.31.2"
        # (25 unchanged attributes hidden)

        # (6 unchanged blocks hidden)
    }

which results with error:

╷
│ Error: release karpenter failed, and has been rolled back due to atomic being set: context deadline exceeded
│ 
│   with helm_release.karpenter[0],
│   on helm.tf line 644, in resource "helm_release" "karpenter":
│  644: resource "helm_release" "karpenter" {
│ 
╵

Only if I delete the kubernetes/helm-charts/karpenter/charts/ and remove the lock file kubernetes/helm-charts/karpenter/Chart.lock the deployment succeeds which makes setting dependency_update: true kinda pointless.

Important Factoids

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
@rovilu
Copy link

rovilu commented Dec 5, 2023

Same problem. Please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants