Browse Source
Add tag to AWS VPC subnets for automatic subnet discovery by load balancers or ingress controllers (#8705)
pull/8707/head
SOPHAL HONG
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
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" |
|
|
|
})) |
|
|
|
} |
|
|
|
|
|
|
|