Skip to content

Commit

Permalink
Remove cluster-name tagging from subnets
Browse files Browse the repository at this point in the history
* These tags were previously required by aws-load-balancer-controller/alb-ingress-controller
* We no longer ship a ingress controller with the module since #225
* aws-load-balancer-controller doesn't need those tags anyway since v2.1.2 - kubernetes-sigs/aws-load-balancer-controller#1773
  • Loading branch information
errm committed Nov 2, 2021
1 parent 6646f5f commit 46f54f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module "vpc" {
name = var.cluster_name
cidr_block = var.cidr_block
availability_zones = var.availability_zones
cluster_names = var.cluster_names
}

module "iam" {
Expand Down
14 changes: 5 additions & 9 deletions modules/vpc/subnets.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
locals {
az_subnet_numbers = zipmap(var.availability_zones, range(0, length(var.availability_zones)))
cluster_tags = { for cluster_name in var.cluster_names : "kubernetes.io/cluster/${cluster_name}" => "shared" }
}

resource "aws_subnet" "public" {
Expand All @@ -11,14 +10,11 @@ resource "aws_subnet" "public" {
vpc_id = aws_vpc.network.id
map_public_ip_on_launch = true

tags = merge(
local.cluster_tags,
{
Name = "${var.name}-public-${each.key}"
"kubernetes.io/role/elb" = "1"
"kubernetes.io/role/alb-ingress" = "1"
}
)
tags = {
Name = "${var.name}-public-${each.key}"
"kubernetes.io/role/elb" = "1"
"kubernetes.io/role/alb-ingress" = "1"
}
}

resource "aws_route_table_association" "public" {
Expand Down
6 changes: 0 additions & 6 deletions modules/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ variable "cidr_block" {
variable "availability_zones" {
description = "The availability zones to create subnets in"
}

variable "cluster_names" {
description = "Names of the EKS clusters deployed in this VPC."
type = list(string)
default = []
}
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ variable "cluster_name" {
description = "A name for the EKS cluster, and the resources it depends on"
}

variable "cluster_names" {
type = list(string)
description = ""
}

variable "cidr_block" {
type = string
description = "The CIDR block for the VPC that EKS will run in"
Expand Down

0 comments on commit 46f54f7

Please sign in to comment.