Coder Social home page Coder Social logo

Comments (11)

ibrokethecloud avatar ibrokethecloud commented on June 4, 2024 1

Possible fix

from helm-controller.

pulpo avatar pulpo commented on June 4, 2024

Same problem here!

from helm-controller.

ibuildthecloud avatar ibuildthecloud commented on June 4, 2024

Can you give an example of a before and after HelmChart CR that fails?

from helm-controller.

ibrokethecloud avatar ibrokethecloud commented on June 4, 2024

I suspect issue is the job uses helm install, which is perform when the args method parses over the helm spec.

https://github.com/rancher/helm-controller/blob/master/pkg/helm/controller.go#L321

To make it more idempotent, we should probably change the args to helm upgrade --install

from helm-controller.

ibrokethecloud avatar ibrokethecloud commented on June 4, 2024

I dug around some more.. here is a sample when install is present

apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
  name: wordpress
  namespace: default
spec:
  targetNamespace: default
  chart: wordpress
  repo: https://charts.bitnami.com/bitnami
  version: 7.4.0
  set:
    persistence.enabled: "false"
    mariadb.master.persistence.enabled: "false"
  helmVersion: v3

Initial install works fine. When I update the manifest to a new version

apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
  name: wordpress
  namespace: default
spec:
  targetNamespace: default
  chart: wordpress
  repo: https://charts.bitnami.com/bitnami
  version: 9.0.0
  set:
    persistence.enabled: "false"
    mariadb.master.persistence.enabled: "false"
  helmVersion: v3

https://github.com/rancher/klipper-helm/blob/master/entry#L33

I suspect check should be [ $INSTALLED_VERSION != $VERSION ] for the upgrade branch to be executed.

Because of equality comparison the code falls through and goes back to the default execution:

https://github.com/rancher/klipper-helm/blob/master/entry#L33

After the tweak, the upgrade works as expected.

Already installed wordpress, upgrading
+ echo Already installed wordpress, upgrading
+ shift 1
+ helm_v3 --namespace default --repo https://charts.bitnami.com/bitnami --version 9.0.0 --set mariadb.master.persistence.enabled=false --set persistence.enabled=false upgrade wordpress wordpress

from helm-controller.

brandonkal avatar brandonkal commented on June 4, 2024

Perhaps using helm upgrade --install would work better.
It should be possible to modify values and redeploy.
I am seeing the same error: Error: cannot re-use a name that is still in use.

The weird thing is that I see this error after deleting the helm chart CR.
I made a change to a helm chart and it caused the helm-install job to fail. I deleted the HelmChart Custom Resource and attempted to reinstall when I saw the Custom Resource actually disappear.

Now I can't install that chart.

from helm-controller.

riazarbi avatar riazarbi commented on June 4, 2024

+1 for this issue. My use case is with jupyterhub on k3s. Deploying initially works fine, redeploying with updates image or what have breaks with Error: cannot re-use a name that is still in use.

On regular k8s we use the helm upgrade --install command for our workflow, so that will probably fix it.

from helm-controller.

brokenjacobs avatar brokenjacobs commented on June 4, 2024

I stopped using this and moved over to using HelmRelease from the fluxcd folks:
https://github.com/fluxcd/helm-operator-get-started

from helm-controller.

gbonnefille avatar gbonnefille commented on June 4, 2024

Seems fixed in klipper-helm v0.2.4 and helm-controller v0.6.3 already ship klipper-helm v0.2.7.

Can this issue be closed? Or problem is still there?

from helm-controller.

ShylajaDevadiga avatar ShylajaDevadiga commented on June 4, 2024

Verified in k3s version v1.19.2+k3s1, above issue is resolved.
Installed openebs chart to validate
INSTALLED_VERSION: 1.8.0
UPGRADED to VERSION: 1.9.0

kubectl describe pod  -n kube-system helm-install-openebs-24mm7  |grep VERSION
      VERSION:          1.8.0

kubectl describe pod  -n kube-system helm-install-openebs-g5vlf |grep VERSION
      VERSION:          1.9.0

from helm-controller.

davidnuzik avatar davidnuzik commented on June 4, 2024

Closing this on behalf of @ShylajaDevadiga
@cjellick or I to fix her permissions.

from helm-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.