Bug 2003896 - (release-4.10) ApiRequestCounts conditional gatherer
Summary: (release-4.10) ApiRequestCounts conditional gatherer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Insights Operator
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.10.0
Assignee: Tomas Remes
QA Contact: Dmitry Misharov
URL:
Whiteboard:
Depends On:
Blocks: 2003893
TreeView+ depends on / blocked
 
Reported: 2021-09-14 06:16 UTC by Tomas Remes
Modified: 2022-03-10 16:10 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2003893
Environment:
Last Closed: 2022-03-10 16:10:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:10:40 UTC

Description Tomas Remes 2021-09-14 06:16:39 UTC
If the APIRemovedInNextEUSReleaseInUse alert is firing then look at its labels, get the resource, version and group from them and find the corresponding APIRequestCounts "record" for this resource and store the record.

Comment 1 Tomas Remes 2021-09-14 06:18:30 UTC
Implemented with https://github.com/openshift/insights-operator/pull/492

Comment 2 Dmitry Misharov 2021-10-19 15:23:22 UTC
Verified on 4.10.0-0.nightly-2021-10-16-173656.

Verification steps:

1. Disable cluster-monitoring-operator:
merge=$(cat <<-__EOF
    {
      "spec": {
        "overrides": [
          [ .spec | .? | .overrides[] | .? | select(.name != "cluster-monitoring-operator")] +
          [{
            "group": "apps/v1",
            "kind": "Deployment",
            "name": "cluster-monitoring-operator",
            "namespace": "openshift-monitoring",
            "unmanaged": true
          }]
        ] | flatten
      }
    }
__EOF
  )

overrides=$(oc get clusterversion version -o json | jq "$merge")
oc patch clusterversion/version --type=merge  -p="$overrides"
oc scale --replicas=0 deployment/cluster-monitoring-operator -n openshift-monitoring
2. Disable prometheus-operator
oc scale --replicas=0 deployment/prometheus-operator -n openshift-monitoring
3. Adjust "APIRemovedInNextEUSReleaseInUse" rule in "prometheus-k8s-rulefiles-0" config map to trigger it
4. Restart "prometheus-k8s" stateful set
oc scale --replicas=0 statefulset/prometheus-k8s -n openshift-monitoring
oc scale --replicas=2 statefulset/prometheus-k8s -n openshift-monitoring
5. Wait until the alert will be firing. You can check it in Prometheus UI:
https://prometheus-k8s-openshift-monitoring.apps.<cluster hostname>
6. Restart the Insights Operator
7. Wait until the archive will be created
8. Download and check the content of the archive.

The archive should content conditional/alerts/APIRemovedInNextEUSReleaseInUse/api_request_counts.json file

Comment 5 errata-xmlrpc 2022-03-10 16:10:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056


Note You need to log in before you can comment on or make changes to this bug.