Skip to content

Commit c183219

Browse files
committed
address comments
1 parent 2f6ce5c commit c183219

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/deploy/subnet_discovery.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ The controller selects one subnet per availability zone. When multiple subnets e
6868
* **ALBs**: Require at least two subnets across different Availability Zones by default
6969

7070
!!! tip
71-
For customers whitelished by the AWS Elastic Load Balancing team, you can enable the [ALBSingleSubnet feature gate](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/configurations/#feature-gates). This allows provisioning an ALB with just one subnet instead of the standard requirement of two subnets.
71+
For customers allowlisted by the AWS Elastic Load Balancing team, you can enable the [ALBSingleSubnet feature gate](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/configurations/#feature-gates). This allows provisioning an ALB with just one subnet instead of the standard requirement of two subnets.

pkg/networking/subnet_resolver.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const (
4141
const (
4242
// both ALB & NLB requires minimal 8 ip address count for it's subnet
4343
defaultMinimalAvailableIPAddressCount = 8
44+
// the ec2's vpcID filter
45+
ec2FilterNameVpcID = "vpc-id"
4446
)
4547

4648
// options for resolve subnets.
@@ -147,7 +149,7 @@ type defaultSubnetsResolver struct {
147149
// - The subnet has a Kubernetes cluster tag matching the current cluster
148150
clusterTagCheckEnabled bool
149151
// whether to enable a single subnet as ALB subnet
150-
// by default ALB requires two subent, only whitelisted users can use a single subnet
152+
// by default ALB requires two subent, only allowlisted users can use a single subnet
151153
albSingleSubnetEnabled bool
152154
// whether to enable discovery subnet by reachability(public/private)
153155
discoverByReachabilityEnabled bool
@@ -281,7 +283,7 @@ func (r *defaultSubnetsResolver) listSubnetsByNames(ctx context.Context, subnetN
281283
req := &ec2sdk.DescribeSubnetsInput{
282284
Filters: []ec2types.Filter{
283285
{
284-
Name: awssdk.String("vpc-id"),
286+
Name: awssdk.String(ec2FilterNameVpcID),
285287
Values: []string{r.vpcID},
286288
},
287289
{
@@ -305,7 +307,7 @@ func (r *defaultSubnetsResolver) listSubnetsByTagFilters(ctx context.Context, ta
305307
req := &ec2sdk.DescribeSubnetsInput{
306308
Filters: []ec2types.Filter{
307309
{
308-
Name: awssdk.String("vpc-id"),
310+
Name: awssdk.String(ec2FilterNameVpcID),
309311
Values: []string{r.vpcID},
310312
},
311313
},
@@ -324,7 +326,7 @@ func (r *defaultSubnetsResolver) listSubnetsByReachability(ctx context.Context,
324326
subnetsReq := &ec2sdk.DescribeSubnetsInput{
325327
Filters: []ec2types.Filter{
326328
{
327-
Name: awssdk.String("vpc-id"),
329+
Name: awssdk.String(ec2FilterNameVpcID),
328330
Values: []string{r.vpcID},
329331
},
330332
},
@@ -336,7 +338,7 @@ func (r *defaultSubnetsResolver) listSubnetsByReachability(ctx context.Context,
336338
routeTablesReq := &ec2sdk.DescribeRouteTablesInput{
337339
Filters: []ec2types.Filter{
338340
{
339-
Name: awssdk.String("vpc-id"),
341+
Name: awssdk.String(ec2FilterNameVpcID),
340342
Values: []string{r.vpcID},
341343
},
342344
},

0 commit comments

Comments
 (0)