Bug 2037625 - AppliedClusterResourceQuotas can not be shown on project overview
Summary: AppliedClusterResourceQuotas can not be shown on project overview
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Yadan Pei
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-06 07:10 UTC by Yadan Pei
Modified: 2022-08-22 15:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:41:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Project ResourceQuotas doesn't show AppliedClusterResourceQuota (874.03 KB, image/png)
2022-01-06 07:10 UTC, Yadan Pei
no flags Details
ResourceQuotas page show AppliedClusterResourceQuota (181.56 KB, image/png)
2022-01-06 07:13 UTC, Yadan Pei
no flags Details
normal user can view ACRQ (295.49 KB, image/png)
2022-02-22 02:17 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11022 0 None open Bug 2037625: Always show ResourceQuota charts 2022-02-09 20:32:09 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:41:49 UTC

Description Yadan Pei 2022-01-06 07:10:32 UTC
Created attachment 1849172 [details]
Project ResourceQuotas doesn't show AppliedClusterResourceQuota

Description of problem:
AppliedClusterResourceQuotas can not be shown on project overview even get appliedclusterresourcequotas requests has successfully got results

Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2022-01-05-181126

How reproducible:
Always

Steps to Reproduce:
1. normal user has a project
$ oc login xxxx -u yapei -p redhat
$ oc new-project yapei-test
2. cluster admin creates clusterresourcequota and targets projects created by user 'yapei'
$ oc create clusterquota for-user --project-annotation-selector openshift.io/requester=yapei --hard pods=10 --hard secrets=20
W0106 14:12:06.237049   57071 shim_kubectl.go:63] Using non-groupfied API resources is deprecated and will be removed in a future release, update apiVersion to "quota.openshift.io/v1" for your resource
clusterresourcequota.quota.openshift.io/for-user created
3. normal user view appliedclusterresourcequota
$ oc get appliedclusterresourcequota
NAME       LABELS SELECTOR   ANNOTATIONS SELECTOR
for-user   <none>            map[openshift.io/requester:yapei2]
4. normal user view project overview at /k8s/cluster/projects/yapei2-project
5. cluster admin user view project overview /k8s/cluster/projects/yapei2-project

Actual results:
4 && 5. In ResourceQuotas section, it shows No AppliedClusterResourceQuotas
GET https://console-openshift-console.apps.qe-ui410-0106.qe.devcluster.openshift.com/api/kubernetes/apis/quota.openshift.io/v1/namespaces/yapei-test/appliedclusterresourcequotas?limit=250
{
  "kind": "AppliedClusterResourceQuotaList",
  "apiVersion": "quota.openshift.io/v1",
  "metadata": {},
  "items": [
    {
      "metadata": {
        "name": "for-user",
        "uid": "bf9dcce2-448a-4994-9229-a5b1b7c4cb16",
        "resourceVersion": "312449",
        "generation": 1,
        "creationTimestamp": "2022-01-06T06:12:06Z",
        "managedFields": [
          {
            "manager": "cluster-policy-controller",
            "operation": "Update",
            "apiVersion": "quota.openshift.io/v1",
            "time": "2022-01-06T06:12:06Z",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:status": {
                ".": {},
                "f:total": {
                  ".": {},
                  "f:hard": {
                    ".": {},
                    "f:pods": {},
                    "f:secrets": {}
                  },
                  "f:used": {
                    ".": {},
                    "f:secrets": {}
                  }
                }
              }
            },
            "subresource": "status"
          },
          {
            "manager": "oc",
            "operation": "Update",
            "apiVersion": "quota.openshift.io/v1",
            "time": "2022-01-06T06:12:06Z",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:spec": {
                ".": {},
                "f:quota": {
                  ".": {},
                  "f:hard": {
                    ".": {},
                    "f:pods": {},
                    "f:secrets": {}
                  }
                },
                "f:selector": {
                  ".": {},
                  "f:annotations": {
                    ".": {},
                    "f:openshift.io/requester": {}
                  },
                  "f:labels": {}
                }
              }
            }
          },
          {
            "manager": "kube-apiserver",
            "operation": "Update",
            "apiVersion": "quota.openshift.io/v1",
            "time": "2022-01-06T06:12:57Z",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:status": {
                "f:namespaces": {},
                "f:total": {
                  "f:used": {
                    "f:pods": {}
                  }
                }
              }
            },
            "subresource": "status"
          }
        ]
      },
      "spec": {
        "selector": {
          "labels": null,
          "annotations": {
            "openshift.io/requester": "yapei2"
          }
        },
        "quota": {
          "hard": {
            "pods": "10",
            "secrets": "20"
          }
        }
      },
      "status": {
        "total": {
          "hard": {
            "pods": "10",
            "secrets": "20"
          },
          "used": {
            "pods": "3",
            "secrets": "9"
          }
        },
        "namespaces": [
          {
            "namespace": "yapei2-project",
            "status": {
              "hard": {
                "pods": "10",
                "secrets": "20"
              },
              "used": {
                "pods": "3",
                "secrets": "9"
              }
            }
          }
        ]
      }
    }
  ]
}

Expected results:
4 && 5. the appliedclusterresourcequota data is successfully fetched and returned, console should show it in project resource quotas

Additional info:
ResourceQuotas page /k8s/ns/yapei2-project/resourcequotas is listing AppliedClusterResourceQuota/for-user correctly
here is the PR added the functionality https://github.com/openshift/console/pull/10137

Comment 1 Yadan Pei 2022-01-06 07:13:20 UTC
Created attachment 1849173 [details]
ResourceQuotas page show AppliedClusterResourceQuota

Comment 2 ralpert 2022-01-07 15:25:01 UTC
Hi @yapei - This is working as intended. I followed the existing behavior for the AppliedClusterResourceQuotas chart. The pre-ACRQ chart only displayed on the details page or project details page if there was data set for limits.cpu, requests.memory, limits.memory, etc. If you add those into your YAML, the chart will show up.

Are you looking to have the behavior changed for all types of data using these charts (ResourceQuota, AppliedClusterResourceQuota, ClusterResourceQuota)?

Comment 4 Yadan Pei 2022-01-11 07:56:14 UTC
Is it consistent with https://github.com/openshift/console/pull/10137? I see the ACRQ chart is shown in project details page even no data set for limits.cpu, requests.memory, limits.memory, am I wrong?

Comment 5 ralpert 2022-01-24 16:15:38 UTC
Hey Yadan - Sorry for the late reply on this; I've been in and out of the office. The lack of data in the charts refers to the fact that there are no resources under the quota that apply to the limit. The data only shows up if there are pods, etc. that are in the project. The charts themselves only show up if there is an actual limit set.

If you try this YAML and create a project called ralpert, you can see that the charts will show up but will be blank unless you add a pod or similar with limits:
apiVersion: quota.openshift.io/v1
kind: ClusterResourceQuota
metadata:
  name: example
spec:
  quota:
    hard:
      pods: 10
      secrets: 10
      requests.cpu: '1'
      requests.memory: 1Gi
      limits.cpu: '2'
      limits.memory: 2Gi
  selector:
    labels:
      matchLabels:
        'kubernetes.io/metadata.name': ralpert

Comment 7 ralpert 2022-01-31 17:42:31 UTC
Hey @yapei - Just following up on this. Are you looking to have the behavior changed for all types of data using these charts (ResourceQuota, AppliedClusterResourceQuota, ClusterResourceQuota)? Or just ACRQs. (It's shared code.) Thanks!

Comment 8 Yadan Pei 2022-02-07 01:21:09 UTC
(In reply to ralpert from comment #7)
> Hey @yapei - Just following up on this. Are you looking to have
> the behavior changed for all types of data using these charts
> (ResourceQuota, AppliedClusterResourceQuota, ClusterResourceQuota)? Or just
> ACRQs. (It's shared code.) Thanks!

Sorry Rebecca, I thought I should already added comments but didn't.
I tried the steps in comment 5, ACRQs are showing on project overview page when limits.cpu, requests.memory, limits.memory, etc values are set

Comment 9 ralpert 2022-02-07 14:35:20 UTC
I think there's a miscommunication here - there is shared code for all the quota charts. I'm trying to figure out if you want to show the charts all the time for all the quotas or if you want to special case ACRQ charts so you don't need that data. Can you let me know how you want to proceed?

Comment 12 Yadan Pei 2022-02-22 02:17:48 UTC
Created attachment 1862482 [details]
normal user can view ACRQ

1. normal user has a project
$ oc login xxxx -u yapei -p redhat
$ oc new-project yapei-test
2. cluster admin creates clusterresourcequota and targets projects created by user 'yapei'
$ oc create clusterquota for-user --project-annotation-selector openshift.io/requester=yapei --hard pods=10 --hard secrets=20
W0106 14:12:06.237049   57071 shim_kubectl.go:63] Using non-groupfied API resources is deprecated and will be removed in a future release, update apiVersion to "quota.openshift.io/v1" for your resource
clusterresourcequota.quota.openshift.io/for-user created
3. normal user view appliedclusterresourcequota
$ oc get appliedclusterresourcequota
NAME       LABELS SELECTOR   ANNOTATIONS SELECTOR
for-user   <none>            map[openshift.io/requester:yapei2]
4. normal user view project overview at /k8s/cluster/projects/yapei2-project
5. cluster admin user view project overview /k8s/cluster/projects/yapei2-project

for 4 and 5, both normal user and cluster admin user can view ARCQ in project overview

verified on 4.11.0-0.nightly-2022-02-18-121223

Comment 13 Yadan Pei 2022-02-22 02:18:12 UTC
ACRQ is always shown on project overview page

Comment 16 errata-xmlrpc 2022-08-10 10:41:16 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 (Important: OpenShift Container Platform 4.11.0 bug fix and 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:5069


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