Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions buildbot/google/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# ~/.config/gcloud/legacy_credentials/<your email>/adc.json
terraform {
backend "gcs" {
bucket = "buildbot_cluster_terraform_backend"
prefix = "terraform/state"
bucket = "buildbot_cluster_terraform_backend"
prefix = "terraform/state"
}
}

# configure Google Cloud project
provider "google" {
project = var.gcp_config.project
region = var.gcp_config.region
project = var.gcp_config.project
region = var.gcp_config.region
}


Expand All @@ -25,10 +25,10 @@ resource "google_compute_network" "vpc_network" {

# Create the cluster runningn all Kubernetes services
resource "google_container_cluster" "primary" {
name = "buildbot-cluster"
name = "buildbot-cluster"
# maybe have a regional cluster for Kubernetes, as we depend on this...
location = var.gcp_config.zone_a

# configure local network, required for Kubernetes on Windows
network = google_compute_network.vpc_network.name
# enable alias IP addresses, required for Kubernetes for Windows
Expand All @@ -51,24 +51,24 @@ resource "google_container_cluster" "primary" {
}

resource "google_container_node_pool" "linux_16_core_pool" {
name = "linux-16-core-pool"
name = "linux-16-core-pool"
# specify a zone here (e.g. "-a") to avoid a redundant deployment
location = var.gcp_config.zone_a
cluster = google_container_cluster.primary.name
location = var.gcp_config.zone_a
cluster = google_container_cluster.primary.name

# use autoscaling to only create a machine when there is a deployment
autoscaling {
min_node_count = 0
max_node_count = 2
}

node_config {
# use preemptible, as this saves costs
preemptible = true
preemptible = true
#custom machine type: 16 core, 48 GB as tsan needs more RAM
machine_type = "n2d-custom-16-49152"
disk_size_gb = 100
disk_type = "pd-ssd"
disk_type = "pd-ssd"

# set the premissions required for the deployment later
oauth_scopes = [
Expand Down
18 changes: 9 additions & 9 deletions buildbot/google/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# configuration parameter for Google Cloud
variable "gcp_config" {
type = object({
project = string
region = string
zone_a = string
gcr_prefix = string
})
project = string
region = string
zone_a = string
gcr_prefix = string
})
default = {
project = "sanitizer-bots"
region = "us-central1"
zone_a = "us-central1-a"
gcr_prefix = "gcr.io/sanitizer-bots"
project = "sanitizer-bots"
region = "us-central1"
zone_a = "us-central1-a"
gcr_prefix = "gcr.io/sanitizer-bots"
}
}