Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-3541

When an ingresscontroller with empty/invalid spec is created and then deleted, "route_metrics_controiller_routes_per_shard" metric displays incorrect value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done-Errata
    • Normal
    • 4.15.0
    • 4.12.0
    • Networking / router
    • None
    • Low
    • Sprint 234, Sprint 235, Sprint 236, Sprint 237, Sprint 238, Sprint 239, Sprint 240, Sprint 242
    • 8
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      * Previously, when creating an IngressController with an empty spec, the IngressController's status shows `Invalid`. However, the `route_controller_metrics_routes_per_shard` metric would still get created. When the invalid IngressController was deleted, the `route_controller_metrics_routes_per_shard` metric would not clear, and it would show information for that metric. With this update, metrics are only created for IngressControllers that are admitted, which resolves this issue. (link:https://issues.redhat.com/browse/OCPBUGS-3541[*OCPBUGS-3541*])
      Show
      * Previously, when creating an IngressController with an empty spec, the IngressController's status shows `Invalid`. However, the `route_controller_metrics_routes_per_shard` metric would still get created. When the invalid IngressController was deleted, the `route_controller_metrics_routes_per_shard` metric would not clear, and it would show information for that metric. With this update, metrics are only created for IngressControllers that are admitted, which resolves this issue. (link: https://issues.redhat.com/browse/OCPBUGS-3541 [* OCPBUGS-3541 *])
    • Bug Fix
    • Done

    Description

      Description of problem:

      When creating an ingresscontroller with empty spec (or where spec.domain clashes with an existing IC), the ingresscontroller's status shows  Admitted as "False" and reason is "Invalid". However, "route_controller_metrics_routes_per_shard" metric shows the shard in the Observe tab of the web-console.
      
      When the invalid ingresscontroller is deleted, the "route_controller_metrics_routes_per_shard" metric
      does not clear the row corresponding to the deleted invalid IC.

      Version-Release number of selected component (if applicable):

      4.12.0-ec5

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create the invalid IC with the following spec:
      
      apiVersion: operator.openshift.io/v1
      kind: IngressController
      metadata:
        name: ic-invalid
        namespace: openshift-ingress-operator
      spec: {}
      
      2. Check the status of the IC:
      
      $ oc get ingresscontroller -n openshift-ingress-operator ic-invalid -oyaml
      apiVersion: operator.openshift.io/v1
      kind: IngressController
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"operator.openshift.io/v1","kind":"IngressController","metadata":{"annotations":{},"name":"ic-invalid","namespace":"openshift-ingress-operator"},"spec":{}}
        creationTimestamp: "2022-11-11T12:53:41Z"
        generation: 1
        name: ic-invalid
        namespace: openshift-ingress-operator
        resourceVersion: "97453"
        uid: 96eae28e-bb14-447e-822f-602f3a3bb378
      spec:
        httpEmptyRequestsPolicy: Respond
      status:
        availableReplicas: 0
        conditions:
        - lastTransitionTime: "2022-11-11T12:53:41Z"
          message: 'conflicts with: default'
          reason: Invalid
          status: "False"
          type: Admitted
        domain: apps.arsen-cluster1.devcluster.openshift.com
        endpointPublishingStrategy:
          loadBalancer:
            dnsManagementPolicy: Managed
            providerParameters:
              aws:
                classicLoadBalancer:
                  connectionIdleTimeout: 0s
                type: Classic
              type: AWS
            scope: External
          type: LoadBalancerService
        observedGeneration: 1
        selector: ""
      
      3. Check the "route_metrics_controller_routes_per_shard" metric on the web-console
      
      4. Delete the IC
      
      5. Check the "route_metrics_controller_routes_per_shard" metric again on the web-console

      Actual results:

      As shown in the attached screenshot, "route_metrics_controller_routes_per_shard" metric adds one row for the
      invalid IC. This is not cleared even when the IC is deleted.

      Expected results:

      The "route_metrics_controller_routes_per_shard" metric should not add metric for invalid ICs.
      Additionally, when the invalid IC is deleted the metric should clear the corresponding row.

      Additional info:

       

       

       

       

      Attachments

        Activity

          People

            gspence@redhat.com Grant Spence
            rh-ee-arsen Arkadeep Sen
            Shudi Li Shudi Li
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: