Skip to content

Commit

Permalink
Add documentation description for feature gate ALBSingleSubnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryhe1999 committed Oct 27, 2023
1 parent 3120390 commit 290c878
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/deploy/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ They are a set of kye=value pairs that describe AWS load balance controller feat
| EnableRGTAPI | string | false | If enabled, the tagging manager will describe resource tags via RGT APIs, otherwise via ELB APIs. In order to enable RGT API, `tag:GetResources` is needed in controller IAM policy. |
| SubnetsClusterTagCheck | string | true | Enable or disable the check for `kubernetes.io/cluster/${cluster-name}` during subnet auto-discovery |
| NLBHealthCheckAdvancedConfiguration | string | true | Enable or disable advanced health check configuration for NLB, for example health check timeout |
| ALBSingleSubnet | string | false | If enabled, controller will allow using only 1 subnet for provisioning ALB, which need to get whitelisted by ELB in advance |
3 changes: 2 additions & 1 deletion docs/deploy/subnet_discovery.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Subnet auto-discovery
By default, the AWS Load Balancer Controller (LBC) auto-discovers network subnets that it can create AWS Network Load Balancers (NLB) and AWS Application Load Balancers (ALB) in. ALBs require at least two subnets across Availability Zones. NLBs require one subnet.
By default, the AWS Load Balancer Controller (LBC) auto-discovers network subnets that it can create AWS Network Load Balancers (NLB) and AWS Application Load Balancers (ALB) in. ALBs require at least two subnets across Availability Zones by default,
set [Feature Gate ALBSingleSubnet](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/configurations/#feature-gates) to "true" allows using only 1 subnet for provisioning ALB. NLBs require one subnet.
The subnets must be tagged appropriately for auto-discovery to work. The controller chooses one subnet from each Availability Zone. During auto-discovery, the controller
considers subnets with at least eight available IP addresses. In the case of multiple qualified tagged subnets in an Availability Zone, the controller chooses the first one in lexicographical
order by the subnet IDs.
Expand Down
4 changes: 2 additions & 2 deletions pkg/networking/subnet_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type SubnetsResolveOptions struct {
AvailableIPAddressCount int64
// whether to check the cluster tag
SubnetsClusterTagCheck bool
// Disable subnet minimal count restriction
// whether to allow using only 1 subnet for provisioning ALB, default to false
ALBSingleSubnet bool
}

Expand Down Expand Up @@ -97,7 +97,7 @@ func WithSubnetsClusterTagCheck(SubnetsClusterTagCheck bool) SubnetsResolveOptio
}
}

// WithALBSingleSubnet generate an option that foncigure ALBSingleSubnet
// WithALBSingleSubnet generate an option that configures ALBSingleSubnet
func WithALBSingleSubnet(ALBSingleSubnet bool) SubnetsResolveOption {
return func(opts *SubnetsResolveOptions) {
opts.ALBSingleSubnet = ALBSingleSubnet
Expand Down

0 comments on commit 290c878

Please sign in to comment.