Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1990

[Operator] Unable to reconcile Backstage CR in a vanilla K8s cluster: no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 1.8.0
    • 1.8.0
    • Operator
    • None
    • RHDH Install 3279

      Description of problem:

      On a vanilla empty K8s cluster, the Operator fails to reconcile any Backstage CR.

      Prerequisites (if any, like setup, operators/versions):

      • Vanilla K8s cluster with no Prometheus operator

      Steps to Reproduce

      From the current main branch of the Operator repo:

      make install run
      
      # In a separate tab
      kubectl apply -f examples/bs1.yaml 
      

      Actual results:

      Reconciliation falis and inspecting the Backstage CR, we can see the following error: "failed to apply ServiceMonitor failed to delete metrics-bs1: no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1""

      [...]
      Status:
        Conditions:
          Last Transition Time:  2025-08-25T20:06:33Z
          Message:               failed to apply ServiceMonitor failed to delete metrics-bs1: no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
          Reason:                DeployFailed
          Status:                False
          Type:                  Deployed
      Events:                    <none>
      

      Expected results:

      Reconciliation should pass. Otherwise, it would break the Operator deployments on our other supported non-OCP platforms.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Tried with the latest commit from the main branch: https://github.com/redhat-developer/rhdh-operator/commit/86650e51745d9514c99d5405d87784dcd4cb33c3

      Additional info (Such as Logs, Screenshots, etc):

      Operator Logs:

      2025-08-25T22:17:29+02:00       INFO    monitoring disabled, deleting any existing ServiceMonitor      {"controller": "backstage", "controllerGroup": "rhdh.redhat.com", "controllerKind": "Backstage", "Backstage": {"name":"bs1","namespace":"my-ns"}, "namespace": "my-ns", "name": "bs1", "reconcileID": "ea15e50a-d97e-4d98-8cdd-f98627f9ed58", "Backstage": "bs1"}
      2025-08-25T22:17:29+02:00       ERROR   Reconciler error        {"controller": "backstage", "controllerGroup": "rhdh.redhat.com", "controllerKind": "Backstage", "Backstage": {"name":"bs1","namespace":"my-ns"}, "namespace": "my-ns", "name": "bs1", "reconcileID": "ea15e50a-d97e-4d98-8cdd-f98627f9ed58", "error": "failed to apply ServiceMonitor: failed to delete metrics-bs1: no matches for kind \"ServiceMonitor\" in version \"monitoring.coreos.com/v1\""}
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
              /home/asoro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.4/pkg/internal/controller/controller.go:316
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
              /home/asoro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.4/pkg/internal/controller/controller.go:263
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2
              /home/asoro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.4/pkg/internal/controller/controller.go:224
      

              rh-ee-asoro Armel Soro
              rh-ee-asoro Armel Soro
              RHIDP - Install
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: