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

Helm release is deleted if the source of the Helm chart has changed. #1095

Open
Subetov opened this issue Oct 27, 2024 · 0 comments
Open

Helm release is deleted if the source of the Helm chart has changed. #1095

Subetov opened this issue Oct 27, 2024 · 0 comments

Comments

@Subetov
Copy link

Subetov commented Oct 27, 2024

Describe the bug a clear and concise description of what the bug is.

Helm release is deleted if the source of the Helm chart has changed. (releaseName is set)
Which in my opinion is a terrible bug (unexpected behavior).
Because Helm itself behaves differently.

Let's imagine that I installed a chart with a database (a critical element of the system), but had to fork the upstream chart to urgently fix a critical bug.
I change spec.chart.specюc.hart of HelmRelease and the operator completely deletes the previous Helm release and installs everything again (there will be revision 1).

{"level":"info","ts":"2024-10-27T14:10:16.521Z","msg":"release target configuration changed (chart name): running uninstall for current release","controller":"helmrelease","controllerGroup":"helm.toolkit.fluxcd.io","controllerKind":"HelmRelease","HelmRelease":{"name":"hello-world","namespace":"test"},"namespace":"test","name":"hello-world","reconcileID":"4140ba43-337c-430c-aa51-f7713d07b252"}

What's your helm version?

v3.15.3

What's your kubectl version?

v1.30.3

What's the chart version?

2.14.0

What happened?

When only the chart source name was changed, the Helm release was removed and reinstalled.

{"level":"info","ts":"2024-10-27T14:10:16.521Z","msg":"release target configuration changed (chart name): running uninstall for current release","controller":"helmrelease","controllerGroup":"helm.toolkit.fluxcd.io","controllerKind":"HelmRelease","HelmRelease":{"name":"hello-world","namespace":"test"},"namespace":"test","name":"hello-world","reconcileID":"4140ba43-337c-430c-aa51-f7713d07b252"}

It would be great if there was at least an option to disable uninstall in such scenario

What you expected to happen?

When the name of the chart source is changed or the chart name changed in the repository, the Helm release is updated, not re-installed. (the revision version of helm release is increased)
(releaseName is set)

How to reproduce it?

  1. Install Flux2
helm upgrade -i flux2-controller fluxcd-community/flux2 -f values.yaml
  1. Apply HelmRepository
cat <<EOF | kubectl apply -f -

apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
  name: gitlab
spec:
  interval: 5m0s
  provider: generic
  suspend: false
  timeout: 60s
  type: oci
  url: oci://registry-1.docker.io/subetov/
status: {}

EOF
  1. Apply HR
cat <<EOF | kubectl apply -f -

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: hello-world
spec:
  chart:
    spec:
      chart: hello-world-chart-forked
      interval: 3m
      reconcileStrategy: ChartVersion
      sourceRef:
        kind: HelmRepository
        name: gitlab
      version: 0.1.1
  install:
    createNamespace: true
    remediation:
      retries: -1
  interval: 5m0s
  releaseName: hello-world
  storageNamespace: test
  suspend: false
  targetNamespace: test
  test: {}
  timeout: 5m0s

EOF
  1. Change spec.chart.specюc.hart in HR and Apply
cat <<EOF | kubectl apply -f -

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: hello-world
spec:
  chart:
    spec:
      chart: hello-world-chart-forked-2
      interval: 3m
      reconcileStrategy: ChartVersion
      sourceRef:
        kind: HelmRepository
        name: gitlab
      version: 0.1.2
  install:
    createNamespace: true
    remediation:
      retries: -1
  interval: 5m0s
  releaseName: hello-world
  storageNamespace: test
  suspend: false
  targetNamespace: test
  test: {}
  timeout: 5m0s

EOF

Enter the changed values of values.yaml?

imageAutomationController:
  create: false

imageReflectionController:
  create: false

kustomizeController:
  create: false

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

No branches or pull requests

1 participant