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

Fails to render stable/prometheus-operator manifests for new install. #189

Closed
mojochao opened this issue Feb 26, 2020 · 11 comments
Closed
Labels

Comments

@mojochao
Copy link

Versions used:

  • helm v3.1.1
  • databus23/helm-diff plugin v3.1.1

Problem observed:

I can successfully install the stable/prometheus-operator chart with helm directly.

$ helm install prometheus-operator stable/prometheus-operator -n monitoring
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
NAME: prometheus-operator
LAST DEPLOYED: Wed Feb 26 13:13:58 2020
NAMESPACE: monitoring
STATUS: deployed
REVISION: 1
NOTES:
The Prometheus Operator has been installed. Check its status by running:
  kubectl --namespace monitoring get pods -l "release=prometheus-operator"

Visit https://github.com/coreos/prometheus-operator for instructions on how
to create & configure Alertmanager and Prometheus instances using the Operator.

If I uninstall the prometheus-operator chart release and just try to helm diff it, it fails with:

$ helm diff --allow-unreleased upgrade -n monitoring prometheus-operator stable/prometheus-operator
********************

	Release was not present in Helm.  Diff will show entire contents as new.

********************
Error: Failed to render chart: exit status 1: manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "Alertmanager" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "PrometheusRule" in version "monitoring.coreos.com/v1", unable to recognize "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"]

Error: plugin "diff" exited with error

I'm using helmfile to drive my installs, and due to this error I am unable to install prometheus-operator with it. Any ideas on fixes or workarounds for this problem?

Many thanks in advance!

@mojochao
Copy link
Author

I believe this is the same issue as #183. Please correct me if I'm wrong.

@Xartos
Copy link
Contributor

Xartos commented Apr 7, 2020

I have the same issue but for another chart.
What I found was that when you run helm diff on an unreleased chart it will run helm template ... --validate which validates the objects with the API server. So in the end this issue is dependent on this issue helm/helm#7449

One solution would be to add a flag that disables the --validate flag here

flags = append(flags, "--validate")

something like --disable-validation

@semoac
Copy link
Contributor

semoac commented May 19, 2020

Hi!

I temporally solve this issue installing helm-diff version 3.0.0-rc.7.
We really need a way to control this behavior when using charts with CRD or tools like helmfile

@mumoshu
Copy link
Collaborator

mumoshu commented Jul 20, 2020

I think this can be resolved by using --disable-openapi-validation. We need to publish a new helm-diff release contains that: #220

@diversario
Copy link

This is still a problem when helm-diff (3.1.3) is used by Helmfile's (0.130.1) apply command.

helmfile apply --suppress-diff --suppress-secrets --skip-deps --args="--disable-openapi-validation"

fails with

Error: Failed to render chart: exit status 1: Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
Error: plugin "diff" exited with error

@mumoshu
Copy link
Collaborator

mumoshu commented Oct 7, 2020

@diversario Could you try setting disableValidation: true on the prometheus-operator release in your helmfile.yaml?

The general rule is that if it works with helm diff upgrade foo prometheus/operator --disable-validation it works with helmfile, too.

@sjentzsch
Copy link

I can confirm it works in Helmfile with:

helmDefaults:
  disableValidation: true

@stale
Copy link

stale bot commented Mar 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 5, 2021
@diversario
Copy link

Missed this, sorry! Yes, it does work with the disableValidation: true, although it's unfortunate that it has to be disabled permanently even though it's required only for the initial install.

@zak905
Copy link

zak905 commented May 13, 2022

As a side note: disabling validation on all the releases may lead to other problems. For example, I got:

Error: chart requires kubeVersion: >=1.19.0-0 which is incompatible with Kubernetes v1.16.0

on the ingress-nginx. Although I have version a version >= 1.21.0, the error is still thrown. This is because without validation, helm cannot pull the Kubernetes version, so it defaults to v1.16.0. Maybe worth disabling validation on the concerned charts only.

@mumoshu
Copy link
Collaborator

mumoshu commented May 14, 2022

@zak905 Thanks for sharing! In case the chart requires a valid .Capabilityes.KubeVersion, --kube-version would be handy #386. Similarly, .Capabilityes.APIVersions can be populated via --api-versions.

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

No branches or pull requests

7 participants