You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add documentation for Scoped HRQs in user guide (#25)
- Introduced a section on using Scoped HRQs, detailing their purpose and functionality.
- Included an example YAML configuration for creating a scoped HRQ.
- Clarified the use of the `scopeSelector` field in relation to Kubernetes ResourceQuota.
This enhances resource management strategies within namespace hierarchies.
Copy file name to clipboardExpand all lines: docs/user-guide/how-to.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,6 +202,34 @@ teams, and those teams can distribute their resources between their subteams.
202
202
203
203
Note: Decimal point values cannot be specified in HRQ (you can't do `cpu: 1.5` but you can do `cpu: "1.5"` or `cpu: 1500m`). See [#292](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/292)
204
204
205
+
#### Using Scoped HRQs
206
+
207
+
In addition to regular HRQs that apply to all resources, you can create **scoped HRQs** that only apply to resources matching specific criteria. This enables more sophisticated resource management strategies within a single namespace hierarchy.
208
+
209
+
- Multiple scoped HRQs can exist in the same namespace hierarchy
210
+
- Each scoped HRQ operates independently and only affects matching resources
211
+
212
+
**Creating a scoped HRQ:**
213
+
214
+
```yaml
215
+
apiVersion: hnc.x-k8s.io/v1alpha2
216
+
kind: HierarchicalResourceQuota
217
+
metadata:
218
+
name: production-workloads
219
+
namespace: team-namespace
220
+
spec:
221
+
hard:
222
+
cpu: "20"
223
+
memory: "40Gi"
224
+
scopeSelector:
225
+
matchExpressions:
226
+
- operator: In
227
+
scopeName: PriorityClass
228
+
values: ["production"]
229
+
```
230
+
231
+
The `scopeSelector` field works exactly like the standard Kubernetes ResourceQuota `scopeSelector`. For details on available scopes and configuration options, see the [Kubernetes ResourceQuota documentation](https://kubernetes.io/docs/concepts/policy/resource-quotas/#quota-scopes).
0 commit comments