mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-15 07:27:15 +00:00
42a898dbd0
* add node pool autoscaling * docs for node pool autoscaling * remove enabled attribute * remove enabled from docs
79 lines
2.3 KiB
Markdown
79 lines
2.3 KiB
Markdown
---
|
|
layout: "google"
|
|
page_title: "Google: google_container_node_pool"
|
|
sidebar_current: "docs-google-container-node-pool"
|
|
description: |-
|
|
Manages a GKE NodePool resource.
|
|
---
|
|
|
|
# google\_container\_node\_pool
|
|
|
|
Manages a Node Pool resource within GKE. For more information see
|
|
[the official documentation](https://cloud.google.com/container-engine/docs/node-pools)
|
|
and
|
|
[API](https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.nodePools).
|
|
|
|
## Example usage
|
|
|
|
```hcl
|
|
resource "google_container_node_pool" "np" {
|
|
name = "my-node-pool"
|
|
zone = "us-central1-a"
|
|
cluster = "${google_container_cluster.primary.name}"
|
|
initial_node_count = 3
|
|
}
|
|
|
|
resource "google_container_cluster" "primary" {
|
|
name = "marcellus-wallace"
|
|
zone = "us-central1-a"
|
|
initial_node_count = 3
|
|
|
|
additional_zones = [
|
|
"us-central1-b",
|
|
"us-central1-c",
|
|
]
|
|
|
|
master_auth {
|
|
username = "mr.yoda"
|
|
password = "adoy.rm"
|
|
}
|
|
|
|
node_config {
|
|
oauth_scopes = [
|
|
"https://www.googleapis.com/auth/compute",
|
|
"https://www.googleapis.com/auth/devstorage.read_only",
|
|
"https://www.googleapis.com/auth/logging.write",
|
|
"https://www.googleapis.com/auth/monitoring",
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
## Argument Reference
|
|
|
|
* `zone` - (Required) The zone in which the cluster resides.
|
|
|
|
* `cluster` - (Required) The cluster to create the node pool for.
|
|
|
|
* `initial_node_count` - (Required) The initial node count for the pool.
|
|
|
|
- - -
|
|
|
|
* `project` - (Optional) The project in which to create the node pool. If blank,
|
|
the provider-configured project will be used.
|
|
|
|
* `name` - (Optional) The name of the node pool. If left blank, Terraform will
|
|
auto-generate a unique name.
|
|
|
|
* `name_prefix` - (Optional) Creates a unique name for the node pool beginning
|
|
with the specified prefix. Conflicts with `name`.
|
|
|
|
* `autoscaling` - (Optional) Configuration required by cluster autoscaler to adjust
|
|
the size of the node pool to the current cluster usage. Structure is documented below.
|
|
|
|
The `autoscaling` block supports:
|
|
|
|
* `minNodeCount` - (Required) Minimum number of nodes in the NodePool. Must be >=1 and
|
|
<= `maxNodeCount`.
|
|
|
|
* `maxNodeCount` - (Required) Maximum number of nodes in the NodePool. Must be >= minNodeCount. |