Add tag to AWS VPC subnets for automatic subnet discovery by load balancers or ingress controllers (#8705)
This commit is contained in:
parent
30306d6ec7
commit
3d4baea01c
1 changed files with 4 additions and 1 deletions
|
@ -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 a new issue