I have scale down issue on my GKE cluster and found out with the right configuration I can solve this.
As the terraform documentation I can use the arguement autoscaling_profile and set it to OPTIMIZE_UTILIZATION
Like so :
resource "google_container_cluster" "k8s_cluster" {
[...]
cluster_autoscaling {
enabled = true
autoscaling_profile = "OPTIMIZE_UTILIZATION"
resource_limits {
resource_type = "cpu"
minimum = 1
maximum = 4
}
resource_limits {
resource_type = "memory"
minimum = 4
maximum = 16
}
}
}
But I got this error :
Error: Unsupported argument on modules/gke/main.tf line 70, in resource "google_container_cluster" "k8s_cluster": 70: autoscaling_profile = "OPTIMIZE_UTILIZATION"
An argument named "autoscaling_profile" is not expected here.
I don't get it ?