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
17 changes: 7 additions & 10 deletions content/en/docs/resource-management/customquotas/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ spec:
- matchLabels:
capsule.clastix.io/tenant: solar
sources:
- group: ""
- apiVersion: v1
kind: Pod
op: count
version: v1
---
apiVersion: capsule.clastix.io/v1beta2
kind: CustomQuota
Expand All @@ -160,10 +159,9 @@ metadata:
spec:
limit: 3
sources:
- group: ""
- apiVersion: v1
kind: Pod
op: count
Comment on lines 160 to 164
version: v1
```

When we now try to create 6 `Pods` in the namespace `solar-test`, we can observe that the `GlobalCustomQuota` allows only 6 Pods in total across all namespaces of the tenant, while the `CustomQuota` allows only 3 Pods in the `solar-test` namespace:
Expand Down Expand Up @@ -195,7 +193,7 @@ We can see that requests are blocked because of the limits by the `CustomQuota`

A quota may define one or many sources. Each source describes:

* which objects are candidates (`group`, `version`, `kind`)
* which objects are candidates (`apiVersion`, `kind`)
* what value is extracted from them ([`path`](#path), if applicable)
* how that value contributes to usage ([`op`](#operations))
* optional additional source-level selectors
Expand All @@ -208,11 +206,10 @@ Sources are evaluated independently and then aggregated into one total.

### GVK

Each source must identify a Kubernetes resource type by Group / Version / Kind. Example for a core Kubernetes Pod:
Each source must identify a Kubernetes resource type by apiVersion / Kind. Example for a core Kubernetes Pod:

```yaml
group: ""
version: v1
apiVersion: v1
kind: Pod
```

Expand Down Expand Up @@ -617,7 +614,7 @@ spec:
op: count
selectors:
- fieldSelectors:
- '.spec.type[?(@=="LoadBalancer")]'
- '.spec.type=="LoadBalancer"'
```

#### Aggregate ephemeral and persistent storage
Expand Down Expand Up @@ -904,7 +901,7 @@ spec:
op: count
selectors:
- fieldSelectors:
- '.spec.type[?(@=="LoadBalancer")]'
- '.spec.type=="LoadBalancer"'
```

#### Limit total memory requests of Pods in one namespace
Expand Down
Loading