The CapacityQuota CustomResourceDefinition (CRD) limits the amount of resources that can be provisioned for specific subsets of nodes that you target by using label selectors. For more information about how CapacityQuotas work, see Configure granular resource limits.
apiVersion: autoscaling.x-k8s.io/v1beta1
kind: CapacityQuota
metadata:
name: capacity-quota
spec:
selector:
matchLabels:
cloud.google.com/compute-class: my-class
matchExpressions:
- key: cloud.google.com/machine-family
operator: In
values:
- c2
- c3
- c3d
limits:
resources:
cpu: 64
memory: 128Gi
status:
observedGeneration: 1
conditions:
- lastTransitionTime: "2026-07-27T10:00:00Z"
message: "CapacityQuota is valid"
reason: "Valid"
status: "True"
type: "cluster-autoscaler.kubernetes.io/valid"
used:
resources:
cpu: "32"
memory: 128Gi
CapacityQuota specification
spec: limits: object (limits) selector: object (selector)
| Fields | |
|---|---|
|
required |
This object defines resource limits for the matched nodes. |
|
optional |
Label selectors to target subsets of nodes. If you omit this field or you don't specify a value, then the CapacityQuota matches all of the nodes in the cluster. |
limits
limits object defines the resource limits of a CapacityQuota.
limits: resources: string: string
| Fields | |
|---|---|
|
required |
The `resources` map define the resource limits of this quota. Map keys are resource names and map values are strings in the resource.Quantity format. The following resource names are supported:
All resource quantities must be integer values that are greater than
|
selector
This is a standard Kubernetes LabelSelector object.
matchExpressions: - object (matchExpressions) matchLabels: string: string
| Fields | |
|---|---|
|
optional |
A list of label selector requirements. The requirements are ANDed. |
|
optional |
A map of key-value pairs. A single entry in the `matchLabels` map is equivalent to an element of `matchExpressions` field, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. |
matchExpressions
This is a standard Kubernetes LabelSelectorRequirement object.
key: string
operator: string
values:
- string
| Fields | |
|---|---|
|
required |
The label key that the selector applies to. |
|
required |
This represents a key's relationship to a set of values. Valid operators are |
|
optional |
This is an array of string values. If the operator is |
status
The status object indicates the observed state of the
CapacityQuota resource.
conditions: - object (Condition) observedGeneration: integer used: object (used)
| Fields | |
|---|---|
conditions[] |
The `conditions` array provide a standard mechanism for reporting the quota's state. |
observedGeneration |
The `observedGeneration` represents the last `.metadata.generation` observed by the controller. |
used |
The `used` object shows the current usage of the quota. |
used
The used object shows the current usage of the quota.
resources:
string: string
| Fields | |
|---|---|
resources |
The `resources` map shows the current usage of the resources defined in the quota limits. |