Skip to content

chore(scaletest): update scaletest terraform to match big.cdr.dev #9860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 27, 2023
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
45 changes: 33 additions & 12 deletions scaletest/terraform/infra/gcp_cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,25 @@ resource "google_container_cluster" "primary" {
workload_identity_config {
workload_pool = "${data.google_project.project.project_id}.svc.id.goog"
}


lifecycle {
ignore_changes = [
maintenance_policy,
release_channel,
remove_default_node_pool
]
}
}

resource "google_container_node_pool" "coder" {
name = "${var.name}-coder"
location = var.zone
project = var.project_id
cluster = google_container_cluster.primary.name
node_count = var.state == "stopped" ? 0 : var.nodepool_size_coder
management {
auto_upgrade = false
name = "${var.name}-coder"
location = var.zone
project = var.project_id
cluster = google_container_cluster.primary.name
autoscaling {
min_node_count = 1
max_node_count = var.nodepool_size_coder
}
node_config {
oauth_scopes = [
Expand All @@ -74,14 +83,20 @@ resource "google_container_node_pool" "coder" {
disable-legacy-endpoints = "true"
}
}
lifecycle {
ignore_changes = [management[0].auto_repair, management[0].auto_upgrade, timeouts]
}
}

resource "google_container_node_pool" "workspaces" {
name = "${var.name}-workspaces"
location = var.zone
project = var.project_id
cluster = google_container_cluster.primary.name
node_count = var.state == "stopped" ? 0 : var.nodepool_size_workspaces
name = "${var.name}-workspaces"
location = var.zone
project = var.project_id
cluster = google_container_cluster.primary.name
autoscaling {
min_node_count = 0
total_max_node_count = var.nodepool_size_workspaces
}
management {
auto_upgrade = false
}
Expand All @@ -107,6 +122,9 @@ resource "google_container_node_pool" "workspaces" {
disable-legacy-endpoints = "true"
}
}
lifecycle {
ignore_changes = [management[0].auto_repair, management[0].auto_upgrade, timeouts]
}
}

resource "google_container_node_pool" "misc" {
Expand Down Expand Up @@ -140,6 +158,9 @@ resource "google_container_node_pool" "misc" {
disable-legacy-endpoints = "true"
}
}
lifecycle {
ignore_changes = [management[0].auto_repair, management[0].auto_upgrade, timeouts]
}
}

resource "null_resource" "cluster_kubeconfig" {
Expand Down
13 changes: 13 additions & 0 deletions scaletest/terraform/infra/gcp_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ resource "google_sql_database_instance" "db" {
record_client_address = false
}
}

lifecycle {
ignore_changes = [deletion_protection, timeouts]
}
}

resource "google_sql_database" "coder" {
Expand All @@ -40,6 +44,9 @@ resource "google_sql_database" "coder" {
name = "${var.name}-coder"
# required for postgres, otherwise db fails to delete
deletion_policy = "ABANDON"
lifecycle {
ignore_changes = [deletion_policy]
}
}

resource "random_password" "coder-postgres-password" {
Expand All @@ -58,6 +65,9 @@ resource "google_sql_user" "coder" {
password = random_password.coder-postgres-password.result
# required for postgres, otherwise user fails to delete
deletion_policy = "ABANDON"
lifecycle {
ignore_changes = [deletion_policy, password]
}
}

resource "google_sql_user" "prometheus" {
Expand All @@ -68,6 +78,9 @@ resource "google_sql_user" "prometheus" {
password = random_password.prometheus-postgres-password.result
# required for postgres, otherwise user fails to delete
deletion_policy = "ABANDON"
lifecycle {
ignore_changes = [deletion_policy, password]
}
}

locals {
Expand Down
2 changes: 1 addition & 1 deletion scaletest/terraform/infra/gcp_vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "google_compute_subnetwork" "subnet" {
project = var.project_id
region = var.region
network = google_compute_network.vpc.name
ip_cidr_range = "10.200.0.0/24"
ip_cidr_range = var.subnet_cidr
}

resource "google_compute_global_address" "sql_peering" {
Expand Down
5 changes: 5 additions & 0 deletions scaletest/terraform/infra/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ variable "zone" {
default = "us-east1-c"
}

variable "subnet_cidr" {
description = "CIDR range for the subnet."
default = "10.200.0.0/24"
}

variable "k8s_version" {
description = "Kubernetes version to provision."
default = "1.24"
Expand Down
Loading