cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

AwsLoadBalancerControllerAddOn: shouldn't it add tags to subnets?

Open rafalkrupinski opened this issue 3 years ago • 1 comments

Describe the bug

According to this manual: https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html we should add tags for the controller to use the subnets in the proper way. It should work without tags, but it's discouraged

Expected Behavior

The AddOn should probably add subnet tags as required by the controller

Current Behavior

No tags are added

Reproduction Steps

xb.EksBlueprint.builder() .account(props.env!.account) .region(props.env!.region) .addOns( new AwsLoadBalancerControllerAddOn, ) .teams(platformTeam) .build(scope, ${id}-cluster);

Possible Solution

I've created a simple addOn. Not sure if it's the right solution

{ deploy(clusterInfo: ClusterInfo): Promise<Construct> | void { const vpc = clusterInfo.getResource(xb.GlobalResources.Vpc) vpc.isolatedSubnets.forEach(subnet => Tags.of(subnet).add("kubernetes.io/role/internal-elb", '1')) vpc.privateSubnets.forEach(subnet => Tags.of(subnet).add("kubernetes.io/role/internal-elb", '1')) vpc.publicSubnets.forEach(subnet => Tags.of(subnet).add("kubernetes.io/role/elb", '1')) } },

Additional Information/Context

No response

CDK CLI Version

2.23.0 (build 50444aa)

EKS Blueprints Version

1.0.1

Node.js Version

v16.13.1

Environment details (OS name and version, etc.)

macos 12.4

Other information

No response

rafalkrupinski avatar Jun 04 '22 13:06 rafalkrupinski

@rafalkrupinski We have made recent enhancements to VPC Provider modules. Please check and reachback if you still face issues.

elamaran11 avatar Oct 12 '23 12:10 elamaran11