Add tag to AWS VPC subnets for automatic subnet discovery by load balancers or ingress controllers (#8705)

pull/8707/head
SOPHAL HONG 2022-04-13 02:05:23 +09:00 committed by GitHub
parent 30306d6ec7
commit 3d4baea01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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"
}))
}