Skip to content

Commit

Permalink
use feature flag to set default ILB
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Dec 3, 2024
1 parent 983bf8b commit 9e35b02
Show file tree
Hide file tree
Showing 4 changed files with 527 additions and 22 deletions.
6 changes: 3 additions & 3 deletions azure/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (
"sigs.k8s.io/cluster-api-provider-azure/azure/services/subnets"
"sigs.k8s.io/cluster-api-provider-azure/azure/services/virtualnetworks"
"sigs.k8s.io/cluster-api-provider-azure/azure/services/vnetpeerings"
"sigs.k8s.io/cluster-api-provider-azure/feature"
"sigs.k8s.io/cluster-api-provider-azure/util/futures"
"sigs.k8s.io/cluster-api-provider-azure/util/tele"
)
Expand Down Expand Up @@ -270,8 +271,7 @@ func (s *ClusterScope) LBSpecs() []azure.ResourceSpecGetter {
},
}
}

if s.APIServerLB().Type != infrav1.Internal {
if s.APIServerLB().Type != infrav1.Internal && feature.Gates.Enabled(feature.APIServerILB) {
specs = append(specs, &loadbalancers.LBSpec{
Name: s.APIServerLB().Name + "-internal",
ResourceGroup: s.ResourceGroup(),
Expand All @@ -284,7 +284,7 @@ func (s *ClusterScope) LBSpecs() []azure.ResourceSpecGetter {
SubnetName: s.ControlPlaneSubnet().Name,
FrontendIPConfigs: []infrav1.FrontendIP{
{
Name: s.APIServerLB().Name + "-internal-frontEnd", // TODO: improve this name.
Name: s.APIServerLB().Name + "-internal-frontEnd",
FrontendIPClass: infrav1.FrontendIPClass{
PrivateIPAddress: infrav1.DefaultInternalLBIPAddress,
},
Expand Down
Loading

0 comments on commit 9e35b02

Please sign in to comment.