Skip to content

Commit

Permalink
add user pool with reduced pd-ssd size
Browse files Browse the repository at this point in the history
should reduce operational costs by ~1k/month

sets autoscale-max on existing user pool to 1 to avoid allocation of new nodes.

Can delete old user pool once it's drained.
  • Loading branch information
minrk committed Jan 18, 2022
1 parent 20ef6c7 commit c975eea
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion terraform/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,50 @@ resource "google_container_node_pool" "user" {
node_locations = ["${local.location}-a"]
version = local.gke_version

autoscaling {
min_node_count = 0
max_node_count = 1
}


node_config {
machine_type = "n1-highmem-8"
disk_size_gb = 1000
disk_type = "pd-ssd"
local_ssd_count = 1

labels = {
"mybinder.org/pool-type" = "users"
}
# https://www.terraform.io/docs/providers/google/r/container_cluster.html#oauth_scopes-1
oauth_scopes = [
"storage-ro",
"logging-write",
"monitoring",
]

metadata = {
disable-legacy-endpoints = "true"
}
}

# do not recreate pools that have been auto-upgraded

lifecycle {
ignore_changes = [
version
]
}
}

resource "google_container_node_pool" "user1" {
name = "user-202209"
cluster = module.mybinder.cluster_name
location = local.location # location of *cluster*
# node_locations lets us specify a single-zone regional cluster:
node_locations = ["${local.location}-a"]
version = local.gke_version

autoscaling {
min_node_count = 2
max_node_count = 12
Expand All @@ -87,7 +131,7 @@ resource "google_container_node_pool" "user" {

node_config {
machine_type = "n1-highmem-8"
disk_size_gb = 1000
disk_size_gb = 500
disk_type = "pd-ssd"
local_ssd_count = 1

Expand Down

0 comments on commit c975eea

Please sign in to comment.