{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25559","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25559/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25559/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25559/events","html_url":"https://github.com/kubernetes/kubernetes/issues/25559","id":154627701,"number":25559,"title":"resource quota calculate object count wrong","user":{"login":"AdoHe","id":1555564,"avatar_url":"https://avatars.githubusercontent.com/u/1555564?v=3","gravatar_id":"","url":"https://api.github.com/users/AdoHe","html_url":"https://github.com/AdoHe","followers_url":"https://api.github.com/users/AdoHe/followers","following_url":"https://api.github.com/users/AdoHe/following{/other_user}","gists_url":"https://api.github.com/users/AdoHe/gists{/gist_id}","starred_url":"https://api.github.com/users/AdoHe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdoHe/subscriptions","organizations_url":"https://api.github.com/users/AdoHe/orgs","repos_url":"https://api.github.com/users/AdoHe/repos","events_url":"https://api.github.com/users/AdoHe/events{/privacy}","received_events_url":"https://api.github.com/users/AdoHe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/control-plane","name":"team/control-plane","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-13T03:39:41Z","updated_at":"2016-05-14T01:19:36Z","closed_at":null,"body":"FYI. I create a resource quota for a namespace, and set the replicationcontrollers number, just like this:\r\n```\r\n[root@localhost ~]# kubectl describe quota --namespace=\"staging\"\r\nName:\t\t\tquota\r\nNamespace:\t\tstaging\r\nResource\t\tUsed\tHard\r\n--------\t\t----\t----\r\ncpu\t\t\t6750m\t20\r\nmemory\t\t\t7936Mi\t20Gi\r\nreplicationcontrollers\t20\t20\r\n```\r\nFrom this output, you can see we have used `20` replicationcontrollers, but if you run `kubectl get rc --namespace=\"staging\"` and sum the number of rc, you will just get `9`, which means actually we just have `9` rc in this namespace. So it seems the resource quota controller can't always observe the rc DELETE.\r\nBesides I am using kubernetes `1.1.4` and my apiserver configuration is:\r\n```\r\n--admission_control=ServiceAccount,NamespaceLifecycle,LimitRanger,ResourceQuota\r\n```\r\n@derekwaynecarr wdyt? I am not very clear whether 1.1.4 has some problems about resource quota."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/219192411","html_url":"https://github.com/kubernetes/kubernetes/issues/25559#issuecomment-219192411","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/25559","id":219192411,"user":{"login":"derekwaynecarr","id":6233452,"avatar_url":"https://avatars.githubusercontent.com/u/6233452?v=3","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T01:19:36Z","updated_at":"2016-05-14T01:19:36Z","body":"Prior to kube 1.2, we were slow to observe deletes.  Did it settle back to\n9 as expected?  The controller manager has a flag that controls how often\nquota is recalculated to observe replenishment.\n\nOn Thursday, May 12, 2016, TonyAdo <notifications@github.com> wrote:\n\n> FYI. I create a resource quota for a namespace, and set the\n> replicationcontrollers number, just like this:\n>\n> [root@localhost ~]# kubectl describe quota --namespace=\"staging\"\n> Name:           quota\n> Namespace:      staging\n> Resource        Used    Hard\n> --------        ----    ----\n> cpu         6750m   20\n> memory          7936Mi  20Gi\n> replicationcontrollers  20  20\n>\n> From this output, you can see we have used 20 replicationcontrollers, but\n> if you run kubectl get rc --namespace=\"staging\" and sum the number of rc,\n> you will just get 13, which means actually we just have 13 rc in this\n> namespace. So it seems the resource quota controller can't always observe\n> the rc DELETE.\n> Besides I am using kubernetes 1.1.4 and my apiserver configuration is:\n>\n> --admission_control=ServiceAccount,NamespaceLifecycle,LimitRanger,ResourceQuota\n>\n> @derekwaynecarr <https://github.com/derekwaynecarr> wdyt? I am not very\n> clear whether 1.1.4 has some problems about resource quota.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/kubernetes/kubernetes/issues/25559>\n>\n"}}