-
Notifications
You must be signed in to change notification settings - Fork 164
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 Chart installation failed due to post renderer yaml unmarshal error #283
Comments
In my option this is a Helm bug, as |
Is there a Flux (or helm-controller) version prior to this where it did work without issues? |
helm-controller : v0.10.0 |
@hiddeco kyaml will error out on duplicate keys, as the YAML is invalid, it used to panic see kubernetes-sigs/kustomize#3480 |
I think the chart should indeed not generate a duplicate annotation label, as that is the root issue here. The reason why it works for |
I have asked to modify the helm chart and here you can see the modification The modification will fix the issue and the problem between Flux and Helm behaviors is a little bit too complex to be tracked here I will close this issue once the chart will install correctly Thanks for the support and the explanation of few internals |
+1 I had a similar issue of having a double entry generated by helm. Something that works for helm (helm or kubectl seem to take care of those double entries). I was able to fork my chart and fix it, but it would be more robust and fool proof if flux would take care of those double entries as well, prior to the reconciliation cycle. |
I faced similar issues with the citrix-ingress-controller helm chart and started debugging it. netscaler/netscaler-helm-charts#101 Feel free to have a look at the PR to understand what I did (and probably leave a like to create some attention) |
Just run into the same problem while upgrading from 0.18.0. to 0.23.0 |
I had the same error :
when I failed to write a proper separator between manifests in the same file (---). While it was correct that it failed, the error was rather hard to understand, perhaps the name of the file in the output would make it easier (since line numbers seem to refer to a given file)? |
I spent too much time trying to debug this until I figured out that the problem was the chart itself. I was confused because the chart was working well when deployed with
To understand the root-cause inside the chart I used Helm template test command to print the Yaml templating result
---
# Source: sonarqube/templates/networkpolicy.yaml
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: test-sonarqube-database
labels:
app: sonarqube
chart: sonarqube-5.4.0
release: test
heritage: Helm
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: postgresql
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app: sonarqube
ports:
- port: 5432
egress:
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- port: 53
protocol: UDP---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: test-sonarqube-additional-network-policy
labels:
app: sonarqube
chart: sonarqube-5.4.0
release: test
heritage: Helm
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
ports:
- port: 9000
protocol: TCP
podSelector:
matchLabels:
app: sonarqube
policyTypes:
- Ingress As you can see, the template is broken. |
Faced a similar problem.
When installing through Helm cli, there is no such problem. |
Helm CLI and Flux v1 both used the client side apply, which is a bit more forgiving. Flux v2 does not permit duplicate entries. If you read the output of Flux v2 is validating through the server-side apply, which parses the YAML and notices things like a duplicate entry. You'll have to fix it upstream in your chart. The most common error is a label that gets placed in some manifest, and then repeated in the template that manifest includes. It should be easy to detect and isolate this error if you pass the output of |
Hi I just wanted to leave a note how to debug such issues: cat > kustomize.sh <<\EOT
#!/bin/bash
cat - > helm-generated-output.yaml
kustomize build . && rm helm-generated-output.yaml
EOT
chmod +x kustomize.sh
cat > kustomization.yaml <<\EOT
resources:
- helm-generated-output.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches: []
EOT example usage: $ helm template kubernetes-asd . --dry-run=server --post-renderer ./kustomize.sh
Error: error while running post render on files: error while running command /Users/kvaps/git/cozystack/packages/apps/kubernetes/kustomize.sh. error output:
Error: map[string]interface {}(nil): yaml: unmarshal errors:
line 54: mapping key "tolerations" already defined at line 18
: exit status 1
Use --debug flag to render out invalid YAML Cheers! |
This PR introduces a new fluxcd-kustomize.sh script that can be used as post-processor for helm for adding a common fluxcd labels. This is very useful for `make diff`, so it will not include diff between these labels anymore Also for debugging specific kustomize cases, eg: - fluxcd/helm-controller#283 - fluxcd/flux2#4368 Signed-off-by: Andrei Kvapil <[email protected]>
I am getting this issue. But in my case, I have re-checked tenths of times for what flux is telling me is duplicated, and I cannot see any duped keys (yaml linting the helm templated with the values.yaml that I am using doesn't show any dupes at all). See related discussion fluxcd/flux2#4890 Anyone apart from @kvaps has any idea on how to debug this issues? I have tried his approach, without success (it gives me no errors...) |
Describe the bug
We were used to deploy the ErpNext Helm Chart using Flux.
Since the Flux upgrade to version 0.15.3 we are facing the following error message:
PS: we are able to deploy the chart with a manual Helm install/upgrade command
Root cause
The helm chart is generating the follow yaml resource:
source code: https://github.com/frappe/helm/blob/c27ba7d38687a9a67331ab555e369b16c79685b5/erpnext/templates/serviceaccount.yaml#L15
The double presence of the label
app.kubernetes.io/name
is the most likely root causeReproduce the issue
Simply follow the ErpNext guide
https://helm.erpnext.com/
Expected behavior
As we are able to deploy the chart with a manual Helm install/upgrade command, we expect that Flux can deploy the chart without the mentioned issue
Additional context
Below please provide the output of the following commands:
The text was updated successfully, but these errors were encountered: