From 35f3b1b28cb48fde0c0831c4b5a80677ce548eb1 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 10 Mar 2018 22:50:29 -0800 Subject: [PATCH] Enable AWS NLB cross-zone load balancing * https://github.com/terraform-providers/terraform-provider-aws/pull/3537 * https://aws.amazon.com/about-aws/whats-new/2018/02/network-load-balancer-now-supports-cross-zone-load-balancing/ --- CHANGES.md | 3 +++ aws/container-linux/kubernetes/apiserver.tf | 2 ++ aws/container-linux/kubernetes/require.tf | 2 +- aws/container-linux/kubernetes/workers/ingress.tf | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ec2ac68b..fd32b3ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,9 @@ Notable changes between versions. * Switch Ingress elastic load balancer to a network load balancer ([#141](https://github.com/poseidon/typhoon/pull/141)) * AWS [NLBs](https://aws.amazon.com/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/) can handle millions of RPS with high throughput and low latency. * Require terraform-provider-aws 1.7.0 or higher +* Enable cross-zone NLB load balancing ([#159](https://github.com/poseidon/typhoon/pull/159)) + * [Announcement](https://aws.amazon.com/about-aws/whats-new/2018/02/network-load-balancer-now-supports-cross-zone-load-balancing/): Requests are automatically evenly distributed to targets regardless of AZ + * Require terraform-provider-aws 1.11.0 or higher * Allow groups of workers to be defined and joined to a cluster (i.e. worker pools) ([#150](https://github.com/poseidon/typhoon/pull/150)) * Add kubelet `--volume-plugin-dir` flag to allow flexvolume plugins ([#142](https://github.com/poseidon/typhoon/pull/142)) * Fix controller and worker launch configs to ignore AMI changes ([#126](https://github.com/poseidon/typhoon/pull/126), [#158](https://github.com/poseidon/typhoon/pull/158)) diff --git a/aws/container-linux/kubernetes/apiserver.tf b/aws/container-linux/kubernetes/apiserver.tf index 04e9f327..f29d1f8d 100644 --- a/aws/container-linux/kubernetes/apiserver.tf +++ b/aws/container-linux/kubernetes/apiserver.tf @@ -20,6 +20,8 @@ resource "aws_lb" "apiserver" { internal = false subnets = ["${aws_subnet.public.*.id}"] + + enable_cross_zone_load_balancing = true } # Forward HTTP traffic to controllers diff --git a/aws/container-linux/kubernetes/require.tf b/aws/container-linux/kubernetes/require.tf index 868c055b..e302aed7 100644 --- a/aws/container-linux/kubernetes/require.tf +++ b/aws/container-linux/kubernetes/require.tf @@ -5,7 +5,7 @@ terraform { } provider "aws" { - version = "~> 1.7" + version = "~> 1.11" } provider "local" { diff --git a/aws/container-linux/kubernetes/workers/ingress.tf b/aws/container-linux/kubernetes/workers/ingress.tf index 59207ca8..6e1599c3 100644 --- a/aws/container-linux/kubernetes/workers/ingress.tf +++ b/aws/container-linux/kubernetes/workers/ingress.tf @@ -5,6 +5,8 @@ resource "aws_lb" "ingress" { internal = false subnets = ["${var.subnet_ids}"] + + enable_cross_zone_load_balancing = true } # Forward HTTP traffic to workers