From ecda9f292a53e4dc7d1e8c1502f3eb30b122b157 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 17 Sep 2019 13:58:38 -0700 Subject: [PATCH] Add support for node_locations to google_container_node_pool. (#4478) Signed-off-by: Modular Magician --- .../docs/r/container_cluster.html.markdown | 17 ++++++++-------- .../docs/r/container_node_pool.html.markdown | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index d8062ab4959..57c49b585a4 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -129,11 +129,9 @@ throughout the region. `region` has been deprecated in favour of `location`. the provider zone is used to create a zonal cluster. * `node_locations` - (Optional) The list of zones in which the cluster's nodes -should be located. These must be in the same region as the cluster zone for -zonal clusters, or in the region of a regional cluster. In a multi-zonal cluster, -the number of nodes specified in `initial_node_count` is created in -all specified zones as well as the primary zone. If specified for a regional -cluster, nodes will be created in only these zones. +are 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 this is specified for +a zonal cluster, omit the cluster's zone. -> A "multi-zonal" cluster is a zonal cluster with at least one additional zone defined; in a multi-zonal cluster, the cluster master is only present in a @@ -194,10 +192,11 @@ for more details. Structure is documented below. Defaults to `false` * `initial_node_count` - (Optional) The number of nodes to create in this - cluster's default node pool. Must be set if `node_pool` is not set. If - you're using `google_container_node_pool` objects with no default node pool, - you'll need to set this to a value of at least `1`, alongside setting - `remove_default_node_pool` to `true`. +cluster's default node pool. In regional or multi-zonal clusters, this is the +number of nodes per zone. Must be set if `node_pool` is not set. If you're using +`google_container_node_pool` objects with no default node pool, you'll need to +set this to a value of at least `1`, alongside setting +`remove_default_node_pool` to `true`. * `ip_allocation_policy` - (Optional) Configuration for cluster IP allocation. As of now, only pre-allocated subnetworks (custom type with secondary ranges) are supported. This will activate IP aliases. See the [official documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-aliases) diff --git a/website/docs/r/container_node_pool.html.markdown b/website/docs/r/container_node_pool.html.markdown index 3e94371333b..eec49756905 100644 --- a/website/docs/r/container_node_pool.html.markdown +++ b/website/docs/r/container_node_pool.html.markdown @@ -98,12 +98,11 @@ resource "google_container_cluster" "primary" { ## Argument Reference -* `cluster` - (Required) The cluster to create the node pool for. Cluster must be present in `zone` provided for zonal clusters. +* `cluster` - (Required) The cluster to create the node pool for. Cluster must be present in `zone` provided for zonal clusters. - - - -* `location` - (Optional) The location (region or zone) in which the cluster -resides. +* `location` - (Optional) The location (region or zone) of the cluster. * `zone` - (Optional, Deprecated) The zone in which the cluster resides. `zone` has been deprecated in favor of `location`. @@ -119,8 +118,9 @@ type-specific `region` for regional clusters / `zone` for zonal clusters. * `autoscaling` - (Optional) Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage. Structure is documented below. -* `initial_node_count` - (Optional) The initial node count for the pool. Changing this will force - recreation of the resource. +* `initial_node_count` - (Optional) The initial number of nodes for the pool. In +regional or multi-zonal clusters, this is the number of nodes per zone. Changing +this will force recreation of the resource. * `management` - (Optional) Node management configuration, wherein auto-repair and auto-upgrade is configured. Structure is documented below. @@ -131,6 +131,16 @@ type-specific `region` for regional clusters / `zone` for zonal clusters. See the [official documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr) for more information. +* `node_locations` - (Optional, [Beta](https://terraform.io/docs/providers/google/provider_versions.html)) +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. + +-> 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. + * `name` - (Optional) The name of the node pool. If left blank, Terraform will auto-generate a unique name.