Skip to content

Commit

Permalink
Merge pull request #3397 from yuvipanda/tag-core
Browse files Browse the repository at this point in the history
gcp: Tag nodes with their purpose for costing purposes
  • Loading branch information
yuvipanda authored Nov 10, 2023
2 parents f853017 + 8e6f669 commit b50605e
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 b50605e

Please sign in to comment.