mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-16 02:31:34 +02:00
Add ability to load balance TCP applications on AWS
* Add ability to load balance TCP applications (e.g. NodePort) * Output the network load balancer ARN as `nlb_id` * Accept a `worker_target_groups` (ARN) list to which worker instances should be added * AWS NLBs and target groups don't support UDP
This commit is contained in:
@ -37,6 +37,11 @@ output "kubeconfig" {
|
||||
|
||||
# Outputs for custom load balancing
|
||||
|
||||
output "nlb_id" {
|
||||
description = "ARN of the Network Load Balancer"
|
||||
value = "${aws_lb.nlb.id}"
|
||||
}
|
||||
|
||||
output "worker_target_group_http" {
|
||||
description = "ARN of a target group of workers for HTTP traffic"
|
||||
value = "${module.workers.target_group_http}"
|
||||
|
@ -71,6 +71,12 @@ variable "worker_price" {
|
||||
description = "Spot price in USD for autoscaling group spot instances. Leave as default empty string for autoscaling group to use on-demand instances. Note, switching in-place from spot to on-demand is not possible: https://github.com/terraform-providers/terraform-provider-aws/issues/4320"
|
||||
}
|
||||
|
||||
variable "worker_target_groups" {
|
||||
type = "list"
|
||||
description = "Additional target group ARNs to which worker instances should be added"
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "controller_clc_snippets" {
|
||||
type = "list"
|
||||
description = "Controller Container Linux Config snippets"
|
||||
|
@ -11,6 +11,7 @@ module "workers" {
|
||||
os_image = "${var.os_image}"
|
||||
disk_size = "${var.disk_size}"
|
||||
spot_price = "${var.worker_price}"
|
||||
target_groups = ["${var.worker_target_groups}"]
|
||||
|
||||
# configuration
|
||||
kubeconfig = "${module.bootkube.kubeconfig-kubelet}"
|
||||
|
@ -64,6 +64,12 @@ variable "spot_price" {
|
||||
description = "Spot price in USD for autoscaling group spot instances. Leave as default empty string for autoscaling group to use on-demand instances. Note, switching in-place from spot to on-demand is not possible: https://github.com/terraform-providers/terraform-provider-aws/issues/4320"
|
||||
}
|
||||
|
||||
variable "target_groups" {
|
||||
type = "list"
|
||||
description = "Additional target group ARNs to which instances should be added"
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "clc_snippets" {
|
||||
type = "list"
|
||||
description = "Container Linux Config snippets"
|
||||
|
@ -19,6 +19,7 @@ resource "aws_autoscaling_group" "workers" {
|
||||
target_group_arns = [
|
||||
"${aws_lb_target_group.workers-http.id}",
|
||||
"${aws_lb_target_group.workers-https.id}",
|
||||
"${var.target_groups}",
|
||||
]
|
||||
|
||||
lifecycle {
|
||||
|
Reference in New Issue
Block a user