-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Google Cloud worker instances to a target pool
* Background: A managed instance group of workers is used in backend services for global load balancing (HTTP/HTTPS Ingress) and output for custom global load balancing use cases * Add worker instances to a target pool load balancing TCP/UDP applications (NodePort or proxied). Output as `worker_target_pool` * Health check for workers with a healthy Ingress controller. Forward rules (regional) to target pools don't support different external and internal ports so choosing nodes with Ingress allows proxying as a workaround * A target pool is a logical grouping only. It doesn't add costs to clusters or worker pools
- Loading branch information
Showing
6 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
# Outputs for global load balancing | ||
|
||
output "instance_group" { | ||
description = "Full URL of the worker managed instance group" | ||
description = "Worker managed instance group full URL" | ||
value = "${google_compute_region_instance_group_manager.workers.instance_group}" | ||
} | ||
|
||
# Outputs for regional load balancing | ||
|
||
output "target_pool" { | ||
description = "Worker target pool self link" | ||
value = "${google_compute_target_pool.workers.self_link}" | ||
} |
21 changes: 21 additions & 0 deletions
21
google-cloud/container-linux/kubernetes/workers/target_pool.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Target pool for TCP/UDP load balancing | ||
resource "google_compute_target_pool" "workers" { | ||
name = "${var.name}-worker-pool" | ||
session_affinity = "NONE" | ||
|
||
health_checks = [ | ||
"${google_compute_http_health_check.workers.name}", | ||
] | ||
} | ||
|
||
# HTTP Health Check (for TCP/UDP load balancing) | ||
# Forward rules (regional) to target pools don't support different external | ||
# and internal ports. Health check for nodes with Ingress controllers that | ||
# may support proxying or otherwise satisfy the check. | ||
resource "google_compute_http_health_check" "workers" { | ||
name = "${var.name}-target-pool-health" | ||
description = "Health check for the worker target pool" | ||
|
||
port = 10254 | ||
request_path = "/healthz" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters