Skip to content

Commit

Permalink
Node pool locations selector (#54)
Browse files Browse the repository at this point in the history
* node_locations

* default

* type

* unspecified

* null default

* include note about manual reconcilation
  • Loading branch information
Azahorscak authored May 4, 2023
1 parent 94f13f6 commit 1ff572a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node_pool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# node-pool-v3.8.1
- Added `node_locations` parameter to limit a node pool to specific zones. Zones selected must be in the parent clusters region. If left empty nodes will default to their parent clusters zones. **Note: node_locations will not revert to the cluster's default set of zones upon being unset. You must manually reconcile the list of zones with your cluster.

# node-pool-v3.8.0
- Added the following values to ignore_changes on the node pool, since they aren't commonly configured but instead set by GKE: `initial_node_count`, `node_config.0.metadata` and `node_config.0.min_cpu_platform`

Expand Down
6 changes: 6 additions & 0 deletions node_pool/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ variable "region" {
description = "The region for the node pool."
}

variable "node_locations" {
type = list
description = "The list of zones in which the node pool's nodes should be located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. If unspecified, the cluster-level node_locations will be used."
default = null
}

variable "disk_size_in_gb" {
description = "Disk size, in GB, for the nodes in the pool."
default = "100"
Expand Down
1 change: 1 addition & 0 deletions node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ resource "google_container_node_pool" "node_pool" {
name = "${var.name}-${random_id.entropy.hex}"
cluster = var.gke_cluster_name
location = var.region
node_locations = var.node_locations
version = var.kubernetes_version
initial_node_count = var.initial_node_count

Expand Down

0 comments on commit 1ff572a

Please sign in to comment.