Add tag to AWS VPC subnets for automatic subnet discovery by load balancers or ingress controllers (#8705)
parent
30306d6ec7
commit
3d4baea01c
|
@ -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"
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue