Helm 3.0.2 dry-run + stable/prometheus-operator? Is this supposed to work?

12/31/2019

With Helm v3.0.2 + a new Kubernetes v1.14.9 cluster.

fyi, I've already added the stable repo:

helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install \
  --namespace prometheus \
  prom-dry-run \
  stable/prometheus-operator \
  --dry-run

manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: info: skipping unknown hook: "crd-install"
manifest_sorter.go:175: 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"]

I thought Helm 3 was backward-compatible with existing charts? Is this an exception?

Is prometheus-operator not compatible with Helm 3? Do I have to use Helm 2? Or is there a backward-compatibility option?

-- clay
kubernetes
kubernetes-helm
prometheus-operator

2 Answers

3/20/2020

CRDs were an exception to the Helm v3 chart compatibility, sadly.

The problem is that --dry-run can't generate resources using the CRDs, because the CRDs aren't installed by the dry run. This is apparently a "documented behaviour" although it was documented in the implementation pull-request, not in the Helm Documentation.


stable/prometheus-operator gained support to Helm v3 in 8.2.0 in mid-November 2019 so that's not the issue here.

bitnami/prometheus-operator gained support in 0.3.0 only a couple of days earlier.

Both appear to be actively maintained at the time of writing (March 2020).

-- TBBle
Source: StackOverflow

12/31/2019

The stable repo is scheduled to be deprecated and probably not updated with latest charts.The canonical source for Helm charts is the Helm Hub. Use below command to add repo and install prometheus operator from Helm Hub using helm 3 or helm 2.

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-prom-release bitnami/prometheus-operator

There is a detailed guide for migrating from helm 2 to helm 3

In helm 3 during a dry run, CRDs are not installed but the Kubernetes validation happens against the output of the chart. So any CR that uses a CRD that is installed by the chart will fail validation during dry run.

Current work-arounds:

1.Use helm template instead of dry run

2.Don't reference CRs in the same chart that has the CRDs

3.Install the CRD separately before running the dry run

-- Arghya Sadhu
Source: StackOverflow