github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/kubernetes/r/limit_range.html.markdown (about)

     1  ---
     2  layout: "kubernetes"
     3  page_title: "Kubernetes: kubernetes_limit_range"
     4  sidebar_current: "docs-kubernetes-resource-limit-range"
     5  description: |-
     6    Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace.
     7  ---
     8  
     9  # kubernetes_limit_range
    10  
    11  Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace.
    12  
    13  Read more in [the official docs](https://kubernetes.io/docs/tasks/configure-pod-container/apply-resource-quota-limit/#applying-default-resource-requests-and-limits).
    14  
    15  
    16  ## Example Usage
    17  
    18  ```hcl
    19  resource "kubernetes_limit_range" "example" {
    20  	metadata {
    21  		name = "terraform-example"
    22  	}
    23  	spec {
    24  		limit {
    25  			type = "Pod"
    26  			max {
    27  				cpu = "200m"
    28  				memory = "1024M"
    29  			}
    30  		}
    31  		limit {
    32  			type = "PersistentVolumeClaim"
    33  			min {
    34  				storage = "24M"
    35  			}
    36  		}
    37  		limit {
    38  			type = "Container"
    39  			default {
    40  				cpu = "50m"
    41  				memory = "24M"
    42  			}
    43  		}
    44  	}
    45  }
    46  ```
    47  
    48  ## Argument Reference
    49  
    50  The following arguments are supported:
    51  
    52  * `metadata` - (Required) Standard limit range's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
    53  * `spec` - (Optional) Spec defines the limits enforced. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
    54  
    55  ## Nested Blocks
    56  
    57  ### `spec`
    58  
    59  #### Arguments
    60  
    61  * `limit` - (Optional) The list of limits that are enforced.
    62  
    63  ### `limit`
    64  
    65  #### Arguments
    66  
    67  * `default` - (Optional) Default resource requirement limit value by resource name if resource limit is omitted.
    68  * `default_request` - (Optional) The default resource requirement request value by resource name if resource request is omitted.
    69  * `max` - (Optional) Max usage constraints on this kind by resource name.
    70  * `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.
    71  * `min` - (Optional) Min usage constraints on this kind by resource name.
    72  * `type` - (Optional) Type of resource that this limit applies to. e.g. `Pod`, `Container` or `PersistentVolumeClaim`
    73  
    74  ### `metadata`
    75  
    76  #### Arguments
    77  
    78  * `annotations` - (Optional) An unstructured key value map stored with the limit range that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations
    79  * `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#idempotency
    80  * `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the limit range. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
    81  * `name` - (Optional) Name of the limit range, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
    82  * `namespace` - (Optional) Namespace defines the space within which name of the limit range must be unique.
    83  
    84  #### Attributes
    85  
    86  * `generation` - A sequence number representing a specific generation of the desired state.
    87  * `resource_version` - An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#concurrency-control-and-consistency
    88  * `self_link` - A URL representing this limit range.
    89  * `uid` - The unique in time and space value for this limit range. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
    90  
    91  ## Import
    92  
    93  Limit Range can be imported using its name, e.g.
    94  
    95  ```
    96  $ terraform import kubernetes_limit_range.example terraform-example
    97  ```