Skip to content

Commit

Permalink
Add support for node_locations to google_container_node_pool. (#4478)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and rileykarson committed Sep 17, 2019
1 parent 146690a commit ecda9f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
17 changes: 8 additions & 9 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 15 additions & 5 deletions website/docs/r/container_node_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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.
Expand All @@ -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.

Expand Down

0 comments on commit ecda9f2

Please sign in to comment.