garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.39k stars 274 forks source link

Helm charts (almost) always re-deploy even when nothing has changed #3473

Open worldofgeese opened 1 year ago

worldofgeese commented 1 year ago

Bug

I make use of a hefty Helm chart (CockroachDB's) inside a helm Garden module. Even when no values have been changed, on garden deploy it's very likely Garden will version and release a new chart to the cluster, which can take up to minutes. One of our community members also experiences this bug.

Current Behavior

Here are two separate releases deployed to my cluster of the same chart. You can see one update can take up to 164 seconds so it's quite costly.

Nothing has changed in the chart or the values provided to the chart.

2022-12-28!UNITO-UNDERSCORE!15h34!UNITO-UNDERSCORE!40

2022-12-29!UNITO-UNDERSCORE!11h02!UNITO-UNDERSCORE!27

Expected behavior

Charts should only cut a new release version when an input value has changed.

Reproducible example

Use my full-fat example with your own authenticated deployment registry defined.

Workaround

None.

Your environment

garden version 0.12.48

ashwiren commented 1 year ago

My experience has been that this only seems to happen if there are garden variables as values in the helm chart values.

If you have a static values in the helm chart then there's no redeployment.

examples: No redeployment

kind: Module
description: In-cluster Redis for glx-connect
type: helm
name: redis
chartPath: ./redis
values:
  architecture: 'standalone'
  auth:
    enabled: false
  master:
    resources:
      limits:
        cpu: 500m
        memory: 256Mi
      requests:
        cpu: 50m
        memory: 128Mi

Redeploys.

kind: Module
description: In-cluster PostgreSQL for Keycloak
disabled: ${var.keycloak.database.rds} # if rds is enabled, see infrastructure-aws
type: helm
name: keycloak-pg
chartPath: ./postgresql
dependencies: 
  - infrastructure-aws
values:
  architecture: 'standalone'
  auth:
    database: ${var.keycloak.database.name}
    username: ${var.keycloak.database.username}
    password: "${runtime.services.infrastructure-aws.outputs.keycloak_db_password}"
vvagaytsev commented 1 year ago

Closing as done via #5138.

vvagaytsev commented 9 months ago

It looks like this is happening again, see https://discord.com/channels/817392104711651328/1199912856355881121/1199912856355881121