Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2134

Update pod selectors in ClowdApp/swatch-metrics definition to expose prometheus data

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Obsolete
    • Icon: Normal Normal
    • None
    • None
    • None
    • None
    • True
    • Hide

      None

      Show
      None
    • False

      We tried exposing prometheus data for swatch-metrics with this PR, but Clowder was failing reconciliation because the Deployment labels are immutable.

      {"level":"error","ts":1705692365.384922,"msg":"Reconciler error","controller":"clowdapp","controllerGroup":"cloud.redhat.com","controllerKind":"ClowdApp","ClowdApp":{"name":"swatch-metrics-rhel","namespace":"rhsm-stage"},"namespace":"rhsm-stage","name":"swatch-metrics-rhel","reconcileID":"23c6d526-fddf-41d0-abe9-d41f631f087c","error":"error updating resource Deployment swatch-metrics-rhel-service: Deployment.apps \"swatch-metrics-rhel-service\" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{\"app\":\"swatch-me… 

      This slack thread has conversation on it that came to the conclusion we should define labels as `podSpec.metadata.labels`.  Clowder needs an update first to support this.

      Done Criteria:

      • Add prometheus: quarkus as a podSpec.metadata.labels to the swatch-metric and swatch-metric-rhel service definitions
      • Don't add labels to the job definitions
      • Don't update the top level ClowdApp prometheus: rhsm label
      • Pod details should have prometheus: quarkus label instead of prometheus: rhsm
        oc get pods -l app=swatch-metrics-rhel -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels}{"\n"}{end}' 
        oc get pods -l app=swatch-metrics -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels}{"\n"}{end}'

              Unassigned Unassigned
              lburnett0 Lindsey Burnett
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: