Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion docs/user-guide/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,34 @@ teams, and those teams can distribute their resources between their subteams.

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)

#### Using Scoped HRQs

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.

- Multiple scoped HRQs can exist in the same namespace hierarchy
- Each scoped HRQ operates independently and only affects matching resources

**Creating a scoped HRQ:**

```yaml
apiVersion: hnc.x-k8s.io/v1alpha2
kind: HierarchicalResourceQuota
metadata:
name: production-workloads
namespace: team-namespace
spec:
hard:
cpu: "20"
memory: "40Gi"
scopeSelector:
matchExpressions:
- operator: In
scopeName: PriorityClass
values: ["production"]
```

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).

<a name="use-select"/>

### Select namespaces based on their hierarchies
Expand Down Expand Up @@ -980,4 +1008,4 @@ Interesting parameters include:
exclude an object from propagation.
* Rancher objects that have the label `cattle.io/creator=norman` are not propagated
by the default manifests (refer to [Concepts: built in exceptions](concepts.md#built-in-exceptions)
for more information).
for more information).