terraform/website/source/docs/providers/kubernetes/r/limit_range.html.markdown

3.9 KiB

layout page_title sidebar_current description
kubernetes Kubernetes: kubernetes_limit_range docs-kubernetes-resource-limit-range Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace.

kubernetes_limit_range

Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace.

Read more in the official docs.

Example Usage

resource "kubernetes_limit_range" "example" {
	metadata {
		name = "terraform-example"
	}
	spec {
		limit {
			type = "Pod"
			max {
				cpu = "200m"
				memory = "1024M"
			}
		}
		limit {
			type = "PersistentVolumeClaim"
			min {
				storage = "24M"
			}
		}
		limit {
			type = "Container"
			default {
				cpu = "50m"
				memory = "24M"
			}
		}
	}
}

Argument Reference

The following arguments are supported:

Nested Blocks

spec

Arguments

  • limit - (Optional) The list of limits that are enforced.

limit

Arguments

  • default - (Optional) Default resource requirement limit value by resource name if resource limit is omitted.
  • default_request - (Optional) The default resource requirement request value by resource name if resource request is omitted.
  • max - (Optional) Max usage constraints on this kind by resource name.
  • max_limit_request_ratio - (Optional) The named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.
  • min - (Optional) Min usage constraints on this kind by resource name.
  • type - (Optional) Type of resource that this limit applies to. e.g. Pod, Container or PersistentVolumeClaim

metadata

Arguments

Attributes

Import

Limit Range can be imported using its name, e.g.

$ terraform import kubernetes_limit_range.example terraform-example