From 5475a8e3b024d4568d31a857917c26192a9d3ad8 Mon Sep 17 00:00:00 2001 From: Max Sokolovsky Date: Mon, 10 Oct 2022 16:49:14 -0400 Subject: [PATCH] Add notes about resource quota resource creation and overrides --- .../about-project-resource-quotas.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/how-to-guides/advanced-user-guides/manage-projects/manage-project-resource-quotas/about-project-resource-quotas.md b/docs/how-to-guides/advanced-user-guides/manage-projects/manage-project-resource-quotas/about-project-resource-quotas.md index eb00082e98b..3c5c50e97df 100644 --- a/docs/how-to-guides/advanced-user-guides/manage-projects/manage-project-resource-quotas/about-project-resource-quotas.md +++ b/docs/how-to-guides/advanced-user-guides/manage-projects/manage-project-resource-quotas/about-project-resource-quotas.md @@ -43,15 +43,23 @@ will assign a resource quota that has a **zero** amount for any resource that re To create a namespace in an existing project via `kubectl`, use the `field.cattle.io/projectId` annotation. To override the default requested quota limit, use the `field.cattle.io/resourceQuota` annotation. + +Note that Rancher will only override limits for resources that are defined on the project quota. + ``` apiVersion: v1 kind: Namespace metadata: annotations: field.cattle.io/projectId: [your-cluster-ID]:[your-project-ID] - field.cattle.io/resourceQuota: '{"limit":{"limitsCpu":"100m", "limitsMemory":"100Mi", "configMaps": "50"}}' + field.cattle.io/resourceQuota: '{"limit":{"limitsCpu":"100m", "configMaps": "50"}}' name: my-ns ``` +In this example, if the project's quota does not include configMaps in its list of resources, then Rancher will ignore `configMaps` in this override. + +Users are advised to create dedicated `ResourceQuota` objects in namespaces to configure additional custom limits for resources not defined on the project. +Resource quotas are native Kubernetes objects, and Rancher will ignore user-defined quotas in namespaces belonging to a project with a quota, +thus giving users more control. The following table explains the key differences between the two quota types.