gke-resource-quotas applied on clusters with 10+ nodes

11/5/2019

The GKE documentation about resource quotas says that those hard limits are only applied for clusters with 10 or fewer nodes.

Even though we have more than 10 nodes, this quota has been created and cannot be deleted

Is this a bug on GKE side or intentional and the documentation is invalid?

-- krstf
google-cloud-platform
google-kubernetes-engine

2 Answers

5/7/2020

I had experienced a really strange error today using GKE. Our hosted gitlab-runner stopped running new jobs, and the message was:

pods "xxxx" is forbidden: exceeded quota: gke-resource-quotas, requested: pods=1, used: pods=1500, limited: pods=1500

So the quota resource is non-editable (as documentation says). The problem, however, that there was just 5 pods running, not 1500. So it can be a kubernetes bug, the way it calculated nodes count, not sure. After upgrading control plane and nodes, the error didn't go away and I didn't know how to reset the counter of nodes.

What did work for me was to simply delete this resource quota. Was surprised that it was even allowed to /shrug.

kubectl delete resourcequota gke-resource-quotas -n gitlab-runner

After that, same resource quota was recreated, and the pods were able to run again.

-- Yarik
Source: StackOverflow

11/5/2019

The "gke-resource-quotas" protects the control plane from being accidentally overloaded by the applications deployed in the cluster that creates excessive amount of kubernetes resources. GKE automatically installs an open source kubernetes ResourceQuota object called ‘gke-resource-quotas’ in each namespace of the cluster. You can get more information about the object by using this command [kubectl get resourcequota gke-resource-quotas -o yaml -n kube-system].

Currently, GKE resource quotas include four kubernetes resources, the number of pods, services, jobs, and ingresses. Their limits are calculated based on the cluster size and other factors. GKE resource quotas are immutable, no change can be made to them either through API or kubectl. The resource name “gke-resource-quotas” is reserved, if you create a ResourceQuota with the same name, it will be overwritten.

-- Adebisi
Source: StackOverflow