Search code examples
kuberneteskubernetes-helmprometheus-operator

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


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?


Solution

  • 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.

    Edit: I forgot to mention the best current workaround is to install the CRDs by hand. Then --dry-run will work. Helm v3 ignores CRDs that are already installed, so you can just leave them there once you're happy with your configuration and do the install for real.

    Upgrading CRDs in Helm is a whole different (not yet resolved) issue.


    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).


    In case anyone comes looking and is confused that the above two chart names are not links: Both have been renamed, and one has moved.

    They are now prometheus-community/kube-prometheus-stack (replaces stable/prometheus-operator) and bitnami/kube-prometheus respectively.