Skip to content

Commit

Permalink
Shift the config cluster to node auto-provisioning and all clusters t…
Browse files Browse the repository at this point in the history
…o an optimize-utilization autoscaling profile
  • Loading branch information
ndebuhr committed Oct 13, 2022
1 parent fd7f9dc commit 34a7a39
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion provisioning/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module "config" {
services_range = "172.17.96.0/19"
region = "northamerica-northeast1"
zones = ["northamerica-northeast1-b", "northamerica-northeast1-c"]
node_count = 1
node_count = 0
autoprovisioning = true
nodes_service_account = module.foundations.nodes_sa_email
spot = false
machine_type = "e2-highcpu-4"
Expand Down
9 changes: 9 additions & 0 deletions provisioning/modules/instance/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ module "gke" {
enable_binary_authorization = true
gce_pd_csi_driver = true
cluster_resource_labels = { "mesh_id" : "proj-${data.google_project.project.number}" }
cluster_autoscaling = {
autoscaling_profile: "OPTIMIZE_UTILIZATION",
enabled: var.autoprovisioning ? true : false,
gpu_resources: [],
max_cpu_cores: 32,
max_memory_gb: 128,
min_cpu_cores: 0,
min_memory_gb: 0
}
node_pools = [
{
name = "core"
Expand Down
11 changes: 8 additions & 3 deletions provisioning/modules/instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,27 @@ variable "zones" {
}

variable "node_count" {
description = "Count of GKE nodes (per zone), if autoscaling is not used"
description = "Count of GKE nodes (per zone), if autoscaling and NAP are not used"
default = 1
}

variable "autoprovisioning" {
description = "Enable GKE node autoprovisioning"
default = false
}

variable "autoscaling" {
description = "Enable GKE node autoscaling"
default = false
}

variable "min_flex" {
description = "Minimum number of GKE nodes, if autoscaling is used"
description = "Minimum number of GKE nodes, if node autoscaling is used"
default = 1
}

variable "max_flex" {
description = "Maximum number of GKE nodes, if autoscaling is used"
description = "Maximum number of GKE nodes, if node autoscaling is used"
default = 1
}

Expand Down
3 changes: 2 additions & 1 deletion provisioning/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ module "config" {
services_range = "172.18.224.0/19"
region = "northamerica-northeast1"
zones = ["northamerica-northeast1-b", "northamerica-northeast1-c"]
node_count = 1
node_count = 0
autoprovisioning = true
nodes_service_account = module.foundations.nodes_sa_email
spot = false
machine_type = "e2-standard-2"
Expand Down

0 comments on commit 34a7a39

Please sign in to comment.