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
Created attachment 1849173 [details] ResourceQuotas page show AppliedClusterResourceQuota
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)?
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?
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
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!
(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
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?
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
ACRQ is always shown on project overview page
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