From 53f2ad3c1633edb1412a639491e1f2cd19f0356f Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sun, 26 Apr 2026 00:28:33 -0500 Subject: [PATCH] Fix Cloud Run probe ports and LB timeout_sec - accounts: add ACCOUNTS_PORT=8080 env var (service defaults to 7753) - api: add SERVER_PORT=8080 env var, change probe path to /actuator/health - LB backends: remove timeout_sec (not supported for serverless NEG backends) --- servers/gcp/cloud-run-accounts.tf | 12 ++++++++++++ servers/gcp/cloud-run-api.tf | 24 ++++++++++++++++++------ servers/gcp/load-balancer-backends.tf | 6 ++---- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/servers/gcp/cloud-run-accounts.tf b/servers/gcp/cloud-run-accounts.tf index 4c82315..794a0b6 100644 --- a/servers/gcp/cloud-run-accounts.tf +++ b/servers/gcp/cloud-run-accounts.tf @@ -43,6 +43,10 @@ resource "google_cloud_run_v2_service" "accounts_us" { name = "ENV" value = "production" } + env { + name = "ACCOUNTS_PORT" + value = "8080" + } env { name = "ACCOUNTS_DATABASE_URL" value_source { @@ -183,6 +187,10 @@ resource "google_cloud_run_v2_service" "accounts_eu" { name = "ENV" value = "production" } + env { + name = "ACCOUNTS_PORT" + value = "8080" + } env { name = "ACCOUNTS_DATABASE_URL" value_source { @@ -321,6 +329,10 @@ resource "google_cloud_run_v2_service" "accounts_apac" { name = "ENV" value = "production" } + env { + name = "ACCOUNTS_PORT" + value = "8080" + } env { name = "ACCOUNTS_DATABASE_URL" value_source { diff --git a/servers/gcp/cloud-run-api.tf b/servers/gcp/cloud-run-api.tf index 6aadd9f..3fd013b 100644 --- a/servers/gcp/cloud-run-api.tf +++ b/servers/gcp/cloud-run-api.tf @@ -42,6 +42,10 @@ resource "google_cloud_run_v2_service" "api_us" { name = "ENV" value = "production" } + env { + name = "SERVER_PORT" + value = "8080" + } env { name = "ACCOUNTS_SERVICE_URL" value = "https://accounts.neurontechnologies.ai" @@ -73,7 +77,7 @@ resource "google_cloud_run_v2_service" "api_us" { startup_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } initial_delay_seconds = 2 @@ -84,7 +88,7 @@ resource "google_cloud_run_v2_service" "api_us" { liveness_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } timeout_seconds = 5 @@ -139,6 +143,10 @@ resource "google_cloud_run_v2_service" "api_eu" { name = "ENV" value = "production" } + env { + name = "SERVER_PORT" + value = "8080" + } env { name = "ACCOUNTS_SERVICE_URL" value = "https://accounts.neurontechnologies.ai" @@ -170,7 +178,7 @@ resource "google_cloud_run_v2_service" "api_eu" { startup_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } initial_delay_seconds = 2 @@ -181,7 +189,7 @@ resource "google_cloud_run_v2_service" "api_eu" { liveness_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } timeout_seconds = 5 @@ -233,6 +241,10 @@ resource "google_cloud_run_v2_service" "api_apac" { name = "ENV" value = "production" } + env { + name = "SERVER_PORT" + value = "8080" + } env { name = "ACCOUNTS_SERVICE_URL" value = "https://accounts.neurontechnologies.ai" @@ -264,7 +276,7 @@ resource "google_cloud_run_v2_service" "api_apac" { startup_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } initial_delay_seconds = 2 @@ -275,7 +287,7 @@ resource "google_cloud_run_v2_service" "api_apac" { liveness_probe { http_get { - path = "/health" + path = "/actuator/health" port = 8080 } timeout_seconds = 5 diff --git a/servers/gcp/load-balancer-backends.tf b/servers/gcp/load-balancer-backends.tf index a7ab25e..f8ab5d2 100644 --- a/servers/gcp/load-balancer-backends.tf +++ b/servers/gcp/load-balancer-backends.tf @@ -57,8 +57,7 @@ resource "google_compute_backend_service" "accounts" { project = var.project_id load_balancing_scheme = "EXTERNAL_MANAGED" protocol = "HTTPS" - timeout_sec = 30 - + # timeout_sec not supported for serverless NEG backends security_policy = google_compute_security_policy.marketing.self_link # No CDN for accounts — responses are user-specific and must not be cached @@ -81,8 +80,7 @@ resource "google_compute_backend_service" "api" { project = var.project_id load_balancing_scheme = "EXTERNAL_MANAGED" protocol = "HTTPS" - timeout_sec = 60 # API calls may be longer (AI inference routing) - + # timeout_sec not supported for serverless NEG backends security_policy = google_compute_security_policy.marketing.self_link enable_cdn = false # API responses are per-request; no CDN benefit