diff --git a/.changelog/5504.txt b/.changelog/5504.txt new file mode 100644 index 00000000000..7635d1b23be --- /dev/null +++ b/.changelog/5504.txt @@ -0,0 +1,3 @@ +```release-note:bug +container: fixed the `ROUTES` value for the `networking_mode` field in `google_container_cluster`. A recent API change unintentionally changed the default to a `VPC_NATIVE` cluster, and removed the ability to create a `ROUTES`-based one. Provider versions prior to this one will default to `VPC_NATIVE` due to this change, and are unable to create `ROUTES` clusters. +``` diff --git a/google/resource_container_cluster.go b/google/resource_container_cluster.go index c093a2ce549..41b037e181e 100644 --- a/google/resource_container_cluster.go +++ b/google/resource_container_cluster.go @@ -2553,6 +2553,7 @@ func expandIPAllocationPolicy(configured interface{}, networkingMode string) (*c } return &container.IPAllocationPolicy{ UseIpAliases: false, + UseRoutes: true, ForceSendFields: []string{"UseIpAliases"}, }, nil } diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index 46b8aa8cb36..fc57cde2d66 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -180,7 +180,7 @@ VPC-native clusters. Adding this block enables [IP aliasing](https://cloud.googl making the cluster VPC-native instead of routes-based. Structure is [documented below](#nested_ip_allocation_policy). -* `networking_mode` - (Optional, [Beta]) Determines whether alias IPs or routes will be used for pod IPs in the cluster. +* `networking_mode` - (Optional) Determines whether alias IPs or routes will be used for pod IPs in the cluster. Options are `VPC_NATIVE` or `ROUTES`. `VPC_NATIVE` enables [IP aliasing](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-aliases), and requires the `ip_allocation_policy` block to be defined. By default when this field is unspecified, GKE will create a `ROUTES`-based cluster.