From 9cdd22cadb193a728e99b2f5d9d5bb486884503a Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 12 Feb 2020 18:31:51 +0000 Subject: [PATCH] Configure autoscaling profile in GKE clusters (#3076) * GKE Cluster Autoscaling profile * autoscaling profile and tests * fix sqladmin api usage * fixes * update documentation * fix sql api url and base path * merge upstream changes to sql * fix indentation character Signed-off-by: Modular Magician --- .changelog/3076.txt | 3 +++ google/resource_container_cluster.go | 1 + website/docs/r/container_cluster.html.markdown | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 .changelog/3076.txt diff --git a/.changelog/3076.txt b/.changelog/3076.txt new file mode 100644 index 00000000000..b3955724ae3 --- /dev/null +++ b/.changelog/3076.txt @@ -0,0 +1,3 @@ +```release-note:REPLACEME +Configure autoscaling profile in GKE clusters (https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#autoscaling_profiles) +``` diff --git a/google/resource_container_cluster.go b/google/resource_container_cluster.go index 8028d990c6b..5f920163077 100644 --- a/google/resource_container_cluster.go +++ b/google/resource_container_cluster.go @@ -2221,6 +2221,7 @@ func flattenClusterAutoscaling(a *containerBeta.ClusterAutoscaling) []map[string r["enabled"] = true r["auto_provisioning_defaults"] = flattenAutoProvisioningDefaults(a.AutoprovisioningNodePoolDefaults) } + return []map[string]interface{}{r} } diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index 7b8e3c16e8e..0c39aca2fa5 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -365,6 +365,11 @@ in addition to node auto-provisioning. Structure is documented below. * `auto_provisioning_defaults` - (Optional) Contains defaults for a node pool created by NAP. Structure is documented below. +* `autoscaling_profile` - (Optional, [Beta](https://terraform.io/docs/providers/google/provider_versions.html)) Configuration +options for the [Autoscaling profile](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#autoscaling_profiles) +feature, which lets you choose whether the cluster autoscaler should optimize for resource utilization or resource availability +when deciding to remove nodes from a cluster. Can be `BALANCED` or `OPTIMIZE_UTILIZATION`. Defaults to `BALANCED`. + The `resource_limits` block supports: * `resource_type` - (Required) The type of the resource. For example, `cpu` and