Search code examples
kubernetesprometheuskubernetes-helmamazon-eksprometheus-blackbox-exporter

Unable to Upgrade Prometheus Blackbox Exporter to v0.24.0 via Helm using chart v8.10.1 on AWS Kubernetes - Error: resource mapping not found for name


I'm trying to upgrade Prometheus Blackbox Exporter to v0.24.0 using Helm chart v8.10.1 on my AWS EKS Kubernetes cluster v1.25 but it is failing with the following error:

helm upgrade -n monitoring prometheus-blackbox-exporter prometheus-community/prometheus-blackbox-exporter --version 8.10.1
Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: resource mapping not found for name: "prometheus-blackbox-exporter" namespace: "monitoring" from "": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"

How to solve this?


Solution

  • Solution:

    First, you need install helm-mapkubeapis (one time action per AWS EKS Kubernetes cluster). Then you need to run helm mapkubeapis for the prometheus-blackbox-exporter Helm release and then you need to delete the prometheus-blackbox-exporter Helm release and then you need to install it again.

    Below you can see all the commands for the above mentioned steps:

    helm plugin install https://github.com/helm/helm-mapkubeapis
    helm mapkubeapis -n monitoring prometheus-blackbox-exporter
    helm del -n monitoring prometheus-blackbox-exporter
    helm install -n monitoring prometheus-blackbox-exporter prometheus-community/prometheus-blackbox-exporter --version 8.10.1
    

    Note: It is assumed that the Prometheus Helm charts repository is already added to your AWS EKS Kubernetes cluster. If not, you can run the following command to do so: helm repo add prometheus-community https://prometheus-community.github.io/helm-charts