From 3d4baea01c2af2f8174fc64a24a2768c4b2dbb96 Mon Sep 17 00:00:00 2001 From: SOPHAL HONG Date: Wed, 13 Apr 2022 02:05:23 +0900 Subject: [PATCH] Add tag to AWS VPC subnets for automatic subnet discovery by load balancers or ingress controllers (#8705) --- contrib/terraform/aws/modules/vpc/main.tf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/terraform/aws/modules/vpc/main.tf b/contrib/terraform/aws/modules/vpc/main.tf index ef9110fab..9cd8b521d 100644 --- a/contrib/terraform/aws/modules/vpc/main.tf +++ b/contrib/terraform/aws/modules/vpc/main.tf @@ -31,7 +31,8 @@ resource "aws_subnet" "cluster-vpc-subnets-public" { tags = merge(var.default_tags, tomap({ Name = "kubernetes-${var.aws_cluster_name}-${element(var.aws_avail_zones, count.index)}-public" - "kubernetes.io/cluster/${var.aws_cluster_name}" = "member" + "kubernetes.io/cluster/${var.aws_cluster_name}" = "shared" + "kubernetes.io/role/elb" = "1" })) } @@ -49,6 +50,8 @@ resource "aws_subnet" "cluster-vpc-subnets-private" { tags = merge(var.default_tags, tomap({ Name = "kubernetes-${var.aws_cluster_name}-${element(var.aws_avail_zones, count.index)}-private" + "kubernetes.io/cluster/${var.aws_cluster_name}" = "shared" + "kubernetes.io/role/internal-elb" = "1" })) }