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

Unable to do helm upgrade #3

Open
nitinSophos opened this issue May 16, 2022 · 2 comments
Open

Unable to do helm upgrade #3

nitinSophos opened this issue May 16, 2022 · 2 comments

Comments

@nitinSophos
Copy link

nitinSophos commented May 16, 2022

Describe the bug
When trying to use the helm chart as mentioned in the Usage, helm upgrade fails

Steps to reproduce the issue:

  1. existing helm chart installed
  2. Download kube-prometheus-stack and integrate with existing chart
  3. add the crd-updater to the kube-prometheus-stack
  4. add the crd-updater.yaml to the templates folder
  5. perform helm upgrade to install the stack

Expected behavior
Helm upgrade should pass and CRDs should get created.

Screenshots
Screenshot 2022-05-16 at 3 30 14 PM
Screenshot 2022-05-16 at 3 29 21 PM
Screenshot 2022-05-16 at 3 29 12 PM
Screenshot 2022-05-16 at 3 29 01 PM
Screenshot 2022-05-16 at 3 28 46 PM

Additional context

root@ubuntu:/home/admin# helm version
version.BuildInfo{Version:"v3.3.4", GitCommit:"a61ce5633af99708171414353ed49547cf05013d", GitTreeState:"clean", GoVersion:"go1.14.9"}
Error Logs:

upgrade.go:121: [debug] preparing upgrade for mycharts upgrade.go:444: [debug] copying values from mycharts (v1) to new release. Error: UPGRADE FAILED: YAML parse error on mycharts/charts/kube-prometheus-stack/templates/crd-updater.yaml: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type releaseutil.SimpleHead helm.go:94: [debug] error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type releaseutil.SimpleHead YAML parse error on mycharts/charts/kube-prometheus-stack/templates/crd-updater.yaml helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort /home/circleci/helm.sh/helm/pkg/releaseutil/manifest_sorter.go:146 helm.sh/helm/v3/pkg/releaseutil.SortManifests /home/circleci/helm.sh/helm/pkg/releaseutil/manifest_sorter.go:106 helm.sh/helm/v3/pkg/action.(*Configuration).renderResources /home/circleci/helm.sh/helm/pkg/action/action.go:163 helm.sh/helm/v3/pkg/action.(*Upgrade).prepareUpgrade /home/circleci/helm.sh/helm/pkg/action/upgrade.go:208 helm.sh/helm/v3/pkg/action.(*Upgrade).Run /home/circleci/helm.sh/helm/pkg/action/upgrade.go:122 main.newUpgradeCmd.func2 /home/circleci/helm.sh/helm/cmd/helm/upgrade.go:154 github.com/spf13/cobra.(*Command).execute /go/pkg/mod/github.com/spf13/[email protected]/command.go:842 github.com/spf13/cobra.(*Command).ExecuteC /go/pkg/mod/github.com/spf13/[email protected]/command.go:950 github.com/spf13/cobra.(*Command).Execute /go/pkg/mod/github.com/spf13/[email protected]/command.go:887 main.main /home/circleci/helm.sh/helm/cmd/helm/helm.go:93 runtime.main /usr/local/go/src/runtime/proc.go:203 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1373 UPGRADE FAILED main.newUpgradeCmd.func2 /home/circleci/helm.sh/helm/cmd/helm/upgrade.go:156 github.com/spf13/cobra.(*Command).execute /go/pkg/mod/github.com/spf13/[email protected]/command.go:842 github.com/spf13/cobra.(*Command).ExecuteC /go/pkg/mod/github.com/spf13/[email protected]/command.go:950 github.com/spf13/cobra.(*Command).Execute /go/pkg/mod/github.com/spf13/[email protected]/command.go:887 main.main /home/circleci/helm.sh/helm/cmd/helm/helm.go:93 runtime.main /usr/local/go/src/runtime/proc.go:203 runtime.goexit

@nitinSophos
Copy link
Author

Update:
As a workaround, I tried putting the content of the .tpl file inside the updater.yaml, it works and is picking up the charts and crds. ( manually hardcoded the values )

  1. But I am still facing an issue with the pre-upgrade hook, the job never runs and hence the upgrade fails as crds are not installed
  2. I tested pre-install, this works, but it's not actually needed, as helm install automatically picks content in crds/
  3. I did not see namespace in your tpl, I had to manually add it to each of them to make it work.

@turip
Copy link
Contributor

turip commented Jun 15, 2022

Can you please somehow share the helm chart in question?

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

2 participants