Error: unable to build kubernetes objects from release manifest: resource mapping not found for name: "swarm-hivemq-swarm" namespace: "swarm" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

Expected behavior

HiveMQ startup completes without exhibiting an error.

Observed behavior

When deploying hivemq/hivemq-swarm from the Helm chart

helm upgrade swarm --install hivemq/hivemq-swarm

There is a ServiceMonitor error observed:

Release "swarm" does not exist. Installing it now. Error: unable to build kubernetes objects from release manifest: resource mapping not found for name: "swarm-hivemq-swarm" namespace: "swarm" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1" ensure CRDs are installed first

Reason

The CRD for the ServiceMonitor does not exist yet.

Affected Version

Solution / Workaround

  • Install kube-prometheus-stack first. It will create CRD for the ServiceMonitor.

helm upgrade prometheus --install prometheus-community/kube-prometheus-stack \ --values values-prometheus.yaml \ --namespace monitoring