GKE node pool

This module creates and manages a node pool in a Google Kubernetes Engine (GKE) cluster separately from the cluster control plane. For more information see the official documentation and the API reference .

Requirements

Name

Version

terraform

>= 1.0

google

>= 4.75.0

Providers

Name

Version

google

>= 4.75.0

Modules

No modules.

Resources

Name

Type

google_container_node_pool.pools

resource

google_container_node_pool.windows_pools

resource

google_client_config.current

data source

Inputs

Name

Description

Type

Default

Required

base_labels

Map of labels used for all node pools, you can add specific labels to specific node pools in node_pools variable with the ‘labels’ key.

map(string)

{}

no

base_metadata

Map of metadata used for all node pools, you can add specific metadata to specific node pools in node_pools variable with the ‘metadata’ key

map(any)

{}

no

base_oauth_scopes

Set of oauth scopes used for all node pools, you can add specific oauth scopes to specific node pools in node_pools variable with the ‘oauth_scopes’ key.

set(string)

[
“https://www.googleapis.com/auth/cloud-platform”
]

no

base_resource_labels

Map of resource labels used for all node pools, you can add specific resource labels to specific node pools in node_pools variable with the ‘resource_labels’ key

map(string)

{}

no

base_tags

Set of tags used for all node pools, you can add specific tags to specific node pools in node_pools variable with the ‘tags’ key.

set(string)

[]

no

base_taints

Map of taints used for all node pools, you can add specific taints to specific node pools in node_pools variable with the ‘taint’ key. Each taint has a value and an effect

map(object({
value = bool
effect = string
}))

{}

no

cluster_location

Location of the GKE cluster to create the node pools for.

string

n/a

yes

cluster_name

Name of the GKE cluster to create the node pools for.

string

n/a

yes

disable_legacy_metadata_endpoints

Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated

bool

true

no

min_master_version

The minimum version of the cluster master

string

null

no

node_metadata

Specifies how node metadata is exposed to the workload running on the node. Possible values are GKE_METADATA, GCE_METADATA, UNSPECIFIED, GKE_METADATA_SERVER or EXPOSE

string

"GKE_METADATA"

no

node_pools

Map of maps containing the node pools configurations. Multiple keys can be used within a node pool configuration, for more information see the documentation

any

{}

no

release_channel

The release channel of this cluster. Accepted values are UNSPECIFIED, RAPID, REGULAR and STABLE. Defaults to REGULAR

string

"REGULAR"

no

service_account

The service account to run nodes

string

""

no

timeouts

A map of timeouts for cluster operations

map(string)

{}

no

windows_node_pools

Map of maps containing Windows node pools configurations. All keys used for node pool configurations in node_pools can be used in windows_node_pools, see : https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool

any

{}

no

Outputs

Name

Description

instance_group_urls

List of GKE generated instance groups

linux_instance_group_urls

List of GKE generated instance groups for Linux node pools

linux_node_pool_names

List of Linux node pool names

linux_node_pool_versions

Linux node pool versions by node pool name

node_pool_names

List of node pool names

node_pool_versions

Node pool versions by node pool name

service_account

The service account to default running nodes as if not overridden in node_pools.

windows_instance_group_urls

List of GKE generated instance groups for Windows node pools

windows_node_pool_names

List of Windows node pool names

windows_node_pool_versions

Windows node pool versions by node pool name

Examples