saer ma
saer ma

Reputation: 31

When I am trying to install Prometheus helm chart, I get this error

I am executing the below-mentioned command to install Prometheus.

helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack

I am getting the below error message. Please advise.

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(Alertmanager.spec): unknown field "alertmanagerConfigNamespaceSelector" in com.coreos.monitoring.v1.Alertmanager.spec, ValidationError(Alertmanager.spec): unknown field "alertmanagerConfigSelector" in com.coreos.monitoring.v1.Alertmanager.spec]

Upvotes: 3

Views: 2885

Answers (2)

Wytrzymały Wiktor
Wytrzymały Wiktor

Reputation: 13898

Hello @saerma and welcome to Stack Overflow!

@rohatgisanat might be right but without seeing your current configs it's impossible to verify that. Please check if that was the case.

There are also two other things you should look for:

  1. If there was any previous installations of other prometheus-relevant manifest files than delete the following:
  • crd alertmanagerconfigs.monitoring.coreos.com
  • alertmanagers.monitoring.coreos.com
  • crd podmonitors.monitoring.coreos.com
  • crd probes.monitoring.coreos.com
  • crd prometheuses.monitoring.coreos.com
  • crd prometheusrules.monitoring.coreos.com
  • crd servicemonitors.monitoring.coreos.com
  • crd thanosrulers.monitoring.coreos.com

Also, check if there are any other Prometheus related config files with:

kubectl get configmap --all-namespaces

and also delete them.

Notice that deleting the CRDs will result in deleting any servicemonitors and so on, which have previously been created by other charts.

After that you can try to install again from scratch.

  1. If installing fresh, run:

kubectl apply -f  https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.45.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml

as CRD changed with the newer version and you need to use the updated ones.

Source.

Upvotes: 3

rohatgisanat
rohatgisanat

Reputation: 828

Looks like the indentation of alertmanagerConfigNamespaceSelector is wrong. It should be on the same level as alertmanagerConfigSelector. Check your values.yaml for the same.

Upvotes: 1

Related Questions