Bug 2030697 - api request counts for current hour are incorrect
Summary: api request counts for current hour are incorrect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: kube-apiserver
Version: 4.8
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.9.z
Assignee: Luis Sanchez
QA Contact: Ke Wang
URL:
Whiteboard:
Depends On: 2021629
Blocks: 2032325
TreeView+ depends on / blocked
 
Reported: 2021-12-09 14:11 UTC by OpenShift BugZilla Robot
Modified: 2022-01-04 18:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2032325 (view as bug list)
Environment:
Last Closed: 2022-01-04 18:41:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift kubernetes pull 1088 0 None open [release-4.9] Bug 2030697: UPSTREAM: <carry>: api request counts for current hour are incorrect 2021-12-13 06:07:56 UTC
Red Hat Knowledge Base (Article) 6329921 0 None None None 2021-12-14 16:45:14 UTC
Red Hat Product Errata RHBA-2021:5214 0 None None None 2022-01-04 18:41:49 UTC

Comment 1 Ke Wang 2021-12-13 15:29:48 UTC
1. On a 4.9 cluster launched by bot with the PR, use a deprecated API,
$ oc get clusterversion
NAME      VERSION                                                  AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.9.0-0.ci.test-2021-12-13-111902-ci-ln-yjsq6b2-latest   True        False         10m     Cluster version is 4.9.0-0.ci.test-2021-12-13-111902-ci-ln-yjsq6b2-latest

2. Get current apirequestcount of horizontalpodautoscalers.v2beta1.autoscaling:
$ oc get apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling
NAME                                           REMOVEDINRELEASE   REQUESTSINCURRENTHOUR   REQUESTSINLAST24H
horizontalpodautoscalers.v2beta1.autoscaling                      1                       4

3. Try to access the deprecated API horizontalpodautoscalers.v2beta1.autoscaling ...
$ oc get horizontalpodautoscalers.v2beta1.autoscaling
W1213 20:08:53.430912 1614951 warnings.go:70] autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+, unavailable in v1.25+; use autoscaling/v2beta2 HorizontalPodAutoscaler
No resources found in default namespace.

----------------------------------
4. After 1 hour(s) later, check the deprecated apirequestcount of horizontalpodautoscalers.v2beta1.autoscaling, no longer has count > 0 for the deprecated API.
$ oc get apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling
NAME                                           REMOVEDINRELEASE   REQUESTSINCURRENTHOUR   REQUESTSINLAST24H
horizontalpodautoscalers.v2beta1.autoscaling                      0                       12

----------------------------------
After 2 hour(s) later, check the deprecated apirequestcount of horizontalpodautoscalers.v2beta1.autoscaling ...
$ oc get apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling
NAME                                           REMOVEDINRELEASE   REQUESTSINCURRENTHOUR   REQUESTSINLAST24H
horizontalpodautoscalers.v2beta1.autoscaling                      0                       20

----------------------------------
5. Delete apiresourcecounts/horizontalpodautoscalers.v2beta1.autoscaling . Observe that it does not get recreated. (wait at least 5 min)
Mon 13 Dec 2021 10:09:04 PM CST
$ oc delete apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling
apirequestcount.apiserver.openshift.io "horizontalpodautoscalers.v2beta1.autoscaling" deleted

Mon 13 Dec 2021 10:19:05 PM CST
Waiting 10 mins, check horizontalpodautoscalers.v2beta1.autoscaling again,
$ oc get apirequestcount | grep "horizontalpodautoscalers.v2beta1.autoscaling"
horizontalpodautoscalers.v2beta1.autoscaling                      1                       1

6. Invoke the deprecated API again and confirm apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling gets recreated.
Mon 13 Dec 2021 10:19:11 PM CST
NAME                                           REMOVEDINRELEASE   REQUESTSINCURRENTHOUR   REQUESTSINLAST24H
$ oc get apirequestcount/horizontalpodautoscalers.v2beta1.autoscaling
horizontalpodautoscalers.v2beta1.autoscaling                      1                       1

Above step 4 and 5 doesn't as expected.

Comment 2 Luis Sanchez 2021-12-13 16:25:41 UTC
@kewang 

Looks good. The horizontalpodautoscalers.v2beta1.autoscaling API, while deprecated, is still in use:

  - In step 2, we see that the API, though deprecated, is in use by someone.
  - In step 3, we see that the API will not be removed for another 3 releases, so it's OK that someone is using it.[1]
  - In step 6, most likely whoever was using the API as shown in step 2, is still using it. 

As such, your verification results are as expected for the horizontalpodautoscalers.v2beta1.autoscaling API.

Comment 7 errata-xmlrpc 2022-01-04 18:41:24 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 (OpenShift Container Platform 4.9.12 bug fix 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/RHBA-2021:5214


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