Skip to content

Commit

Permalink
gcp: Tag nodes with their purpose for costing purposes
Browse files Browse the repository at this point in the history
Helps more easily separate the cost of various parts of
the infrastructure.

Unfortunately this *does* recreate the nodes in the node-pool,
so will have to be rolled out slowly with appropriate timing.

I've rolled this out for the 2i2c-uk cluster.

Ref #3350
  • Loading branch information
yuvipanda committed Nov 10, 2023
1 parent e4316a5 commit 8e6f669
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions terraform/gcp/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ resource "google_container_node_pool" "core" {
# Faster disks provide faster image pulls!
disk_type = "pd-balanced"

resource_labels = {
"node-purpose" : "core"
}

labels = {
"hub.jupyter.org/node-purpose" = "core",
"k8s.dask.org/node-purpose" = "core"
Expand Down Expand Up @@ -336,7 +340,9 @@ resource "google_container_node_pool" "notebook" {
"https://www.googleapis.com/auth/cloud-platform"
]

resource_labels = each.value.resource_labels
resource_labels = merge({
"node-purpose" : "notebook"
}, each.value.resource_labels)

// Set these values explicitly so they don't "change outside terraform"
tags = []
Expand Down Expand Up @@ -416,7 +422,9 @@ resource "google_container_node_pool" "dask_worker" {
"https://www.googleapis.com/auth/cloud-platform"
]

resource_labels = each.value.resource_labels
resource_labels = merge({
"node-purpose" : "dask-worker"
}, each.value.resource_labels)

// Set these values explicitly so they don't "change outside terraform"
tags = []
Expand Down

0 comments on commit 8e6f669

Please sign in to comment.