Skip to content

Commit 92954f0

Browse files
committed
Remove load balancer infra for logs collector
1 parent 02fb3ca commit 92954f0

File tree

10 files changed

+10
-205
lines changed

10 files changed

+10
-205
lines changed

iac/provider-gcp/main.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ module "cluster" {
105105
loki_node_pool = var.loki_node_pool
106106
orchestrator_node_pool = var.orchestrator_node_pool
107107

108-
logs_health_proxy_port = var.logs_health_proxy_port
109-
logs_proxy_port = var.logs_proxy_port
110-
111108
edge_api_port = var.edge_api_port
112109
edge_proxy_port = var.edge_proxy_port
113110
api_port = var.api_port
@@ -202,10 +199,6 @@ module "nomad" {
202199

203200
domain_name = var.domain_name
204201

205-
# Telemetry
206-
logs_health_proxy_port = var.logs_health_proxy_port
207-
logs_proxy_port = var.logs_proxy_port
208-
209202
# Logs
210203
loki_node_pool = var.loki_node_pool
211204
loki_machine_count = var.loki_cluster_size

iac/provider-gcp/nomad-cluster/main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ module "network" {
106106
build_instance_group = google_compute_instance_group_manager.build_pool.instance_group
107107
server_instance_group = google_compute_instance_group_manager.server_pool.instance_group
108108

109-
nomad_port = var.nomad_port
110-
logs_proxy_port = var.logs_proxy_port
111-
logs_health_proxy_port = var.logs_health_proxy_port
109+
nomad_port = var.nomad_port
112110

113111
cluster_tag_name = var.cluster_tag_name
114112

iac/provider-gcp/nomad-cluster/network/main.tf

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,6 @@ locals {
100100
health_checked_backends = { for backend_index, backend_value in local.backends : backend_index => backend_value }
101101
}
102102

103-
# ======== IP ADDRESSES ====================
104-
105-
// todo: (2025-09-22): this can be removed when all orchestrator will be rolled with internal logs collector server
106-
resource "google_compute_global_address" "orch_logs_ip" {
107-
name = "${var.prefix}logs-ip"
108-
}
109-
110-
111103
# ======== CLOUDFLARE ====================
112104

113105
data "cloudflare_zone" "domain" {
@@ -441,73 +433,6 @@ resource "google_compute_security_policy" "default" {
441433
}
442434
}
443435

444-
module "gce_lb_http_logs" {
445-
source = "GoogleCloudPlatform/lb-http/google"
446-
version = "~> 12.1"
447-
name = "${var.prefix}external-logs-endpoint"
448-
project = var.gcp_project_id
449-
address = google_compute_global_address.orch_logs_ip.address
450-
create_address = false
451-
target_tags = [var.cluster_tag_name]
452-
firewall_networks = [var.network_name]
453-
454-
labels = var.labels
455-
backends = {
456-
default = {
457-
description = null
458-
protocol = "HTTP"
459-
port = var.logs_proxy_port.port
460-
port_name = var.logs_proxy_port.name
461-
timeout_sec = 20
462-
connection_draining_timeout_sec = 1
463-
enable_cdn = false
464-
session_affinity = null
465-
affinity_cookie_ttl_sec = null
466-
custom_request_headers = null
467-
custom_response_headers = null
468-
security_policy = google_compute_security_policy.disable-bots-log-collector.self_link
469-
470-
health_check = {
471-
check_interval_sec = null
472-
timeout_sec = null
473-
healthy_threshold = null
474-
unhealthy_threshold = null
475-
request_path = var.logs_health_proxy_port.health_path
476-
port = var.logs_health_proxy_port.port
477-
host = null
478-
logging = null
479-
}
480-
481-
log_config = {
482-
enable = false
483-
sample_rate = 0.0
484-
}
485-
486-
groups = [
487-
{
488-
group = var.client_instance_group
489-
balancing_mode = null
490-
capacity_scaler = null
491-
description = null
492-
max_connections = null
493-
max_connections_per_instance = null
494-
max_connections_per_endpoint = null
495-
max_rate = null
496-
max_rate_per_instance = null
497-
max_rate_per_endpoint = null
498-
max_utilization = null
499-
},
500-
]
501-
502-
iap_config = {
503-
enable = false
504-
oauth2_client_id = ""
505-
oauth2_client_secret = ""
506-
}
507-
}
508-
}
509-
}
510-
511436
# Firewalls
512437
resource "google_compute_firewall" "default-hc" {
513438
name = "${var.prefix}load-balancer-hc"
@@ -558,26 +483,6 @@ resource "google_compute_firewall" "client_proxy_firewall_ingress" {
558483
source_ranges = ["130.211.0.0/22", "35.191.0.0/16"]
559484
}
560485

561-
resource "google_compute_firewall" "logs_collector_firewall_ingress" {
562-
name = "${var.prefix}${var.cluster_tag_name}-logs-collector-firewall-ingress"
563-
network = var.network_name
564-
565-
allow {
566-
protocol = "tcp"
567-
# Health end point is already added by load balancer module automatically, but also adding it here just to make sure we don't remove it by accident
568-
ports = [var.logs_proxy_port.port, var.logs_health_proxy_port.port]
569-
}
570-
571-
priority = 999
572-
573-
direction = "INGRESS"
574-
target_tags = [var.cluster_tag_name]
575-
# Load balancer health check IP ranges
576-
# https://cloud.google.com/load-balancing/docs/health-check-concepts
577-
source_ranges = ["130.211.0.0/22", "35.191.0.0/16"]
578-
}
579-
580-
581486
resource "google_compute_firewall" "internal_remote_connection_firewall_ingress" {
582487
name = "${var.prefix}${var.cluster_tag_name}-internal-remote-connection-firewall-ingress"
583488
network = var.network_name
@@ -764,31 +669,3 @@ resource "google_compute_security_policy_rule" "disable-consul" {
764669
}
765670
}
766671
}
767-
768-
resource "google_compute_security_policy" "disable-bots-log-collector" {
769-
name = "disable-bots-log-collector"
770-
771-
rule {
772-
action = "allow"
773-
priority = "300"
774-
match {
775-
expr {
776-
expression = "request.path == \"/\" && request.method == \"POST\""
777-
}
778-
}
779-
780-
description = "Allow POST requests to / (collecting logs)"
781-
}
782-
783-
rule {
784-
action = "deny(403)"
785-
priority = "2147483647"
786-
description = "Default rule, higher priority overrides it"
787-
match {
788-
versioned_expr = "SRC_IPS_V1"
789-
config {
790-
src_ip_ranges = ["*"]
791-
}
792-
}
793-
}
794-
}

iac/provider-gcp/nomad-cluster/network/outputs.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

iac/provider-gcp/nomad-cluster/network/variables.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ variable "client_proxy_port" {
6363
})
6464
}
6565

66-
variable "logs_proxy_port" {
67-
type = object({
68-
name = string
69-
port = number
70-
})
71-
}
72-
73-
variable "logs_health_proxy_port" {
74-
type = object({
75-
name = string
76-
port = number
77-
health_path = string
78-
})
79-
}
80-
8166
variable "nomad_port" {
8267
type = number
8368
}

iac/provider-gcp/nomad-cluster/nodepool-client.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ resource "google_compute_region_instance_group_manager" "client_pool" {
7474
instance_template = google_compute_instance_template.client.id
7575
}
7676

77-
named_port {
78-
name = var.logs_health_proxy_port.name
79-
port = var.logs_health_proxy_port.port
80-
}
81-
82-
named_port {
83-
name = var.logs_proxy_port.name
84-
port = var.logs_proxy_port.port
85-
}
86-
8777
auto_healing_policies {
8878
health_check = google_compute_health_check.client_nomad_check.id
8979
initial_delay_sec = 600
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
output "logs_proxy_ip" {
2-
value = module.network.logs_proxy_ip
3-
}
4-
51
output "shared_chunk_cache_path" {
62
value = var.filestore_cache_enabled ? "${local.nfs_mount_path}/${local.nfs_mount_subdir}" : ""
73
}

iac/provider-gcp/nomad-cluster/variables.tf

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,22 +155,6 @@ variable "network_name" {
155155
default = "default"
156156
}
157157

158-
variable "logs_proxy_port" {
159-
type = object({
160-
name = string
161-
port = number
162-
})
163-
}
164-
165-
variable "logs_health_proxy_port" {
166-
type = object({
167-
name = string
168-
port = number
169-
health_path = string
170-
})
171-
}
172-
173-
174158
variable "google_service_account_email" {
175159
type = string
176160
}

iac/provider-gcp/nomad/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ variable "logs_proxy_port" {
179179
name = string
180180
port = number
181181
})
182+
default = {
183+
name = "logs"
184+
port = 30006
185+
}
182186
}
183187

184188
variable "logs_health_proxy_port" {
@@ -187,6 +191,11 @@ variable "logs_health_proxy_port" {
187191
port = number
188192
health_path = string
189193
})
194+
default = {
195+
name = "logs-health"
196+
port = 44313
197+
health_path = "/health"
198+
}
190199
}
191200

192201
variable "analytics_collector_host_secret_name" {

iac/provider-gcp/variables.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,30 +177,6 @@ variable "edge_proxy_port" {
177177
}
178178
}
179179

180-
variable "logs_proxy_port" {
181-
type = object({
182-
name = string
183-
port = number
184-
})
185-
default = {
186-
name = "logs"
187-
port = 30006
188-
}
189-
}
190-
191-
variable "logs_health_proxy_port" {
192-
type = object({
193-
name = string
194-
port = number
195-
health_path = string
196-
})
197-
default = {
198-
name = "logs-health"
199-
port = 44313
200-
health_path = "/health"
201-
}
202-
}
203-
204180
variable "loki_cluster_size" {
205181
type = number
206182
default = 0

0 commit comments

Comments
 (0)