Difference between revisions of "Cluster autoscaling"

From wikieduonline
Jump to navigation Jump to search
 
(17 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#  
 
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#  
  cluster_autoscaling
+
 
 +
* [[google_container_cluster]]
 +
 
 +
== Example ==
 +
  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
 +
    }
 +
  Ref: https://stackoverflow.com/a/63684343
 +
 
 +
[[autoscaling_profile]]: [ BALANCED | OPTIMIZE_UTILIZATION ]
 +
 
 +
 
 +
Incomplete example, <code>[[resource_limits]]</code> are mandatory:
 
   cluster_autoscaling {
 
   cluster_autoscaling {
 
     enabled = true
 
     enabled = true
 
   }
 
   }
 +
 +
== Errors ==
 +
 +
google_container_cluster.primary: Modifying... [id=projects/your-project/locations/us-central1- a/clusters/your-project-gke]
 +
 +
│ Error: [[googleapi]]: Error 400: Resource limits for cpu, memory must be specified when enabling node [[autoprovisioning]]., badRequest
 +
 +
│  with google_container_cluster.primary,
 +
│  on [[gke.tf]] line 2, in resource "google_container_cluster" "primary":
 +
│    2: resource "google_container_cluster" "primary" {
 +
 +
  
  
== Errors ==
 
 
  ╷
 
  ╷
 
  │ [[Error: Unsupported argument]]
 
  │ [[Error: Unsupported argument]]
Line 17: Line 50:
 
  │ An argument named "cluster_autoscaling" is not expected here. [[Did you mean to define a block of type]] "cluster_autoscaling"?
 
  │ An argument named "cluster_autoscaling" is not expected here. [[Did you mean to define a block of type]] "cluster_autoscaling"?
 
  ╵
 
  ╵
 
  
 
== Related ==
 
== Related ==
 
* [[Terraform blocks|Block]]
 
* [[Terraform blocks|Block]]
 +
* <code>[[--enable-autoprovisioning]]</code>
 +
* [[Kubernetes autoscaling]]
 +
* [[cpu:]]
 +
* <code>[[terraform plan]], [[terraform apply]]</code>
 +
 +
== Activities ==
 +
* Review
 +
* https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/93#issuecomment-554397982
  
 
== See also ==
 
== See also ==
* {{tf gcp}}
+
* {{google_container_cluster}}
 +
* {{tf GKE}}
 +
 
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 21:01, 4 December 2023

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#

Example[edit]

 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
   }
Ref: https://stackoverflow.com/a/63684343
autoscaling_profile: [ BALANCED | OPTIMIZE_UTILIZATION ]


Incomplete example, resource_limits are mandatory:

  cluster_autoscaling {
    enabled = true
  }

Errors[edit]

google_container_cluster.primary: Modifying... [id=projects/your-project/locations/us-central1- a/clusters/your-project-gke]
╷
│ Error: googleapi: Error 400: Resource limits for cpu, memory must be specified when enabling node autoprovisioning., badRequest
│
│   with google_container_cluster.primary,
│   on gke.tf line 2, in resource "google_container_cluster" "primary":
│    2: resource "google_container_cluster" "primary" {
│
╵


╷
│ Error: Unsupported argument
│
│   on gke.tf line 15, in resource "google_container_cluster" "primary":
│   15:   cluster_autoscaling = true
│
│ An argument named "cluster_autoscaling" is not expected here. Did you mean to define a block of type "cluster_autoscaling"?
╵

Related[edit]

Activities[edit]

See also[edit]

Advertising: