A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project.
resource "kubernetes_resource_quota_v1" "example" {
metadata {
name = "terraform-example"
}
spec {
hard = {
pods = 10
}
scopes = ["BestEffort"]
}
}
The following arguments are supported:
metadata
- (Required) Standard resource quota's metadata. For more info see Kubernetes referencespec
- (Optional) Spec defines the desired quota. Kubernetes referencemetadata
annotations
- (Optional) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata.labels
- (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services.name
- (Optional) Name of the resource quota, must be unique. Cannot be updated. For more info see Kubernetes referencenamespace
- (Optional) Namespace defines the space within which name of the resource quota must be unique.generation
- A sequence number representing a specific generation of the desired state.resource_version
- An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. For more info see Kubernetes referenceuid
- The unique in time and space value for this resource quota. For more info see Kubernetes referencespec
hard
- (Optional) The set of desired hard limits for each named resource. For more info see Kubernetes referencescopes
- (Optional) A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects.scope_selector
- (Optional) A collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. See scope_selector
below for more details.scope_selector
match_expression
- (Optional) A list of scope selector requirements by scope of the resources. See match_expression
below for more details.match_expression
scope_name
- (Required) The name of the scope that the selector applies to. Valid values are Terminating
, NotTerminating
, BestEffort
, NotBestEffort
, and PriorityClass
.operator
- (Required) Represents a scope's relationship to a set of values. Valid operators are In
, NotIn
, Exists
, DoesNotExist
.values
- (Optional) A list of scope selector requirements by scope of the resources.Resource Quota can be imported using its namespace and name, e.g.
$ terraform import kubernetes_resource_quota_v1.example default/terraform-example