Skip to content

Commit ea23d0c

Browse files
committed
doc update
1 parent b77f802 commit ea23d0c

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

docs/deploy/configurations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,4 @@ They are a set of kye=value pairs that describe AWS load balance controller feat
147147
| EndpointsFailOpen | string | false | Enable or disable allowing endpoints with `ready:unknown` state in the target groups. |
148148
| EnableServiceController | string | true | Toggles support for `Service` type resources. |
149149
| EnableIPTargetType | string | true | Used to toggle support for target-type `ip` across `Ingress` and `Service` type resources. |
150+
| SubnetsClusterTagCheck | string | true | Enable or disable the check for `kubernetes.io/cluster/${cluster-name}` during subnet auto-discovery |

docs/deploy/subnet_discovery.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ In version v2.1.1 and older, both the public and private subnets must be tagged
3131

3232
`${cluster-name}` is the name of the kubernetes cluster
3333

34-
The cluster tag is not required in v2.1.2 and newer releases, unless a cluster tag for another cluster is present.
34+
The cluster tag is not required in versions from v2.1.2 to v2.4.1, unless a cluster tag for another cluster is present.
35+
36+
Starting from v2.4.2 release, you can disable the cluster tag check completely by specifying the feature gate `SubnetsClusterTagCheck=false`

pkg/ingress/model_build_load_balancer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ import (
66
"encoding/hex"
77
"fmt"
88
"regexp"
9-
"sigs.k8s.io/aws-load-balancer-controller/pkg/config"
109
"strings"
1110

12-
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/tracking"
13-
1411
awssdk "github.com/aws/aws-sdk-go/aws"
1512
ec2sdk "github.com/aws/aws-sdk-go/service/ec2"
1613
"github.com/google/go-cmp/cmp"
1714
"github.com/pkg/errors"
1815
"k8s.io/apimachinery/pkg/util/sets"
1916
"sigs.k8s.io/aws-load-balancer-controller/pkg/algorithm"
2017
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
18+
"sigs.k8s.io/aws-load-balancer-controller/pkg/config"
19+
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/tracking"
2120
"sigs.k8s.io/aws-load-balancer-controller/pkg/equality"
2221
"sigs.k8s.io/aws-load-balancer-controller/pkg/k8s"
2322
"sigs.k8s.io/aws-load-balancer-controller/pkg/model/core"

pkg/ingress/model_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package ingress
22

33
import (
44
"context"
5-
"sigs.k8s.io/aws-load-balancer-controller/pkg/config"
65
"testing"
76
"time"
87

@@ -21,6 +20,7 @@ import (
2120
"k8s.io/client-go/tools/record"
2221
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
2322
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
23+
"sigs.k8s.io/aws-load-balancer-controller/pkg/config"
2424
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy"
2525
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/elbv2"
2626
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/tracking"

pkg/networking/subnet_resolver.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,28 @@ func defaultSubnetsResolveOptions() SubnetsResolveOptions {
6565

6666
type SubnetsResolveOption func(opts *SubnetsResolveOptions)
6767

68-
// WithSubnetsResolveLBType generates a option that configures LBType.
68+
// WithSubnetsResolveLBType generates an option that configures LBType.
6969
func WithSubnetsResolveLBType(lbType elbv2model.LoadBalancerType) SubnetsResolveOption {
7070
return func(opts *SubnetsResolveOptions) {
7171
opts.LBType = lbType
7272
}
7373
}
7474

75-
// WithSubnetsResolveLBScheme generates a option that configures LBScheme.
75+
// WithSubnetsResolveLBScheme generates an option that configures LBScheme.
7676
func WithSubnetsResolveLBScheme(lbScheme elbv2model.LoadBalancerScheme) SubnetsResolveOption {
7777
return func(opts *SubnetsResolveOptions) {
7878
opts.LBScheme = lbScheme
7979
}
8080
}
8181

82-
// WithSubnetsResolveAvailableIPAddressCount generates a option that configures AvailableIPAddressCount.
82+
// WithSubnetsResolveAvailableIPAddressCount generates an option that configures AvailableIPAddressCount.
8383
func WithSubnetsResolveAvailableIPAddressCount(AvailableIPAddressCount int64) SubnetsResolveOption {
8484
return func(opts *SubnetsResolveOptions) {
8585
opts.AvailableIPAddressCount = AvailableIPAddressCount
8686
}
8787
}
8888

89-
// WithSubnetsResolveAvailableIPAddressCount generates a option that configures AvailableIPAddressCount.
89+
// WithSubnetsClusterTagCheck generates an option that configures SubnetsClusterTagCheck.
9090
func WithSubnetsClusterTagCheck(SubnetsClusterTagCheck bool) SubnetsResolveOption {
9191
return func(opts *SubnetsResolveOptions) {
9292
opts.SubnetsClusterTagCheck = SubnetsClusterTagCheck
@@ -96,10 +96,12 @@ func WithSubnetsClusterTagCheck(SubnetsClusterTagCheck bool) SubnetsResolveOptio
9696
// SubnetsResolver is responsible for resolve EC2 Subnets for Load Balancers.
9797
type SubnetsResolver interface {
9898
// ResolveViaDiscovery resolve subnets by auto discover matching subnets.
99-
// * if SubnetClusterTagCheck is enabled, the discovered subnets within clusterVPC must contain the "kubernetes.io/cluster/<cluster-name>" tag
99+
// Discovery candidate includes all subnets within the clusterVPC. Additionally,
100100
// * for internet-facing Load Balancer, "kubernetes.io/role/elb" tag must presents.
101101
// * for internal Load Balancer, "kubernetes.io/role/internal-elb" tag must presents.
102-
// * if multiple subnets are found for specific AZ, one subnet is chosen based on the lexical order of subnetID.
102+
// * if SubnetClusterTagCheck is enabled, subnets within the clusterVPC must contain no cluster tag at all
103+
// or contain the "kubernetes.io/cluster/<cluster_name>" tag for the current cluster
104+
// If multiple subnets are found for specific AZ, one subnet is chosen based on the lexical order of subnetID.
103105
ResolveViaDiscovery(ctx context.Context, opts ...SubnetsResolveOption) ([]*ec2sdk.Subnet, error)
104106

105107
// ResolveViaNameOrIDSlice resolve subnets using subnet name or ID.
@@ -351,6 +353,7 @@ func (r *defaultSubnetsResolver) checkSubnetHasClusterTag(subnet *ec2sdk.Subnet)
351353
// checkSubnetIsNotTaggedForOtherClusters checks whether the subnet is tagged for the current cluster
352354
// or it doesn't contain the cluster tag at all. If the subnet contains a tag for other clusters, then
353355
// this check returns false so that the subnet does not used for the load balancer.
356+
// it returns true if the subnetsClusterTagCheck is disabled
354357
func (r *defaultSubnetsResolver) checkSubnetIsNotTaggedForOtherClusters(subnet *ec2sdk.Subnet, subnetsClusterTagCheck bool) bool {
355358
if !subnetsClusterTagCheck {
356359
return true

0 commit comments

Comments
 (0)