Skip to content

Commit

Permalink
Merge pull request #3768 from nilo19/chore/sku
Browse files Browse the repository at this point in the history
chore: set default loadBalancerSKU to Standard
  • Loading branch information
k8s-ci-robot committed Apr 20, 2023
2 parents 9291c6d + 2b14601 commit 8eb0d6a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/provider/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,10 @@ func (az *Cloud) initCaches() (err error) {
}

func (az *Cloud) setLBDefaults(config *Config) error {
if config.LoadBalancerSku == "" {
config.LoadBalancerSku = consts.LoadBalancerSkuStandard
}

if strings.EqualFold(config.LoadBalancerSku, consts.LoadBalancerSkuStandard) {
// Do not add master nodes to standard LB by default.
if config.ExcludeMasterFromStandardLB == nil {
Expand Down
10 changes: 10 additions & 0 deletions pkg/provider/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3917,3 +3917,13 @@ func TestFindSecurityRule(t *testing.T) {
assert.Equal(t, testCases[i].expected, found, testCases[i].desc)
}
}

func TestSetLBDefaults(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
az := GetTestCloud(ctrl)

config := &Config{}
_ = az.setLBDefaults(config)
assert.Equal(t, config.LoadBalancerSku, consts.LoadBalancerSkuStandard)
}

0 comments on commit 8eb0d6a

Please sign in to comment.