Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

chore: use Standard LoadBalancer as default #2998

Merged
merged 1 commit into from Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions examples/dualstack/kubernetes.json
Expand Up @@ -8,8 +8,6 @@
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true,
"clusterSubnet": "10.244.0.0/16,fc00::/8",
"serviceCidr": "10.0.0.0/16,fd00::/108",
"dnsServiceIP": "10.0.0.10",
Expand Down Expand Up @@ -54,4 +52,4 @@
"secret": ""
}
}
}
}
Expand Up @@ -40,9 +40,7 @@
"name": "aad-pod-identity",
"enabled": true
}
],
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true
]
}
},
"masterProfile": {
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/const.go
Expand Up @@ -176,8 +176,6 @@ const (
BasicLoadBalancerSku = "Basic"
// StandardLoadBalancerSku is the string const for Azure Standard Load Balancer
StandardLoadBalancerSku = "Standard"
// DefaultLoadBalancerSku determines the aks-engine provided default for enabling Azure cloudprovider load balancer SKU
DefaultLoadBalancerSku = BasicLoadBalancerSku
// DefaultExcludeMasterFromStandardLB determines the aks-engine provided default for excluding master nodes from standard load balancer.
DefaultExcludeMasterFromStandardLB = true
// DefaultSecureKubeletEnabled determines the aks-engine provided default for securing kubelet communications
Expand Down
12 changes: 1 addition & 11 deletions pkg/api/defaults.go
Expand Up @@ -371,11 +371,7 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) {
}
a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = DefaultAzureStackLoadBalancerSku
} else if a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku == "" {
if a.HasAvailabilityZones() {
a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = StandardLoadBalancerSku
} else {
a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = DefaultLoadBalancerSku
}
a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = StandardLoadBalancerSku
}

if strings.ToLower(a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku) == strings.ToLower(BasicLoadBalancerSku) {
Expand Down Expand Up @@ -417,9 +413,6 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) {
}

// Master-specific defaults that depend upon OrchestratorProfile defaults
if cs.Properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku == StandardLoadBalancerSku {
cs.Properties.OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB = to.BoolPtr(DefaultExcludeMasterFromStandardLB)
}
if cs.Properties.MasterProfile != nil {
if !cs.Properties.MasterProfile.IsCustomVNET() {
if cs.Properties.OrchestratorProfile.IsAzureCNI() {
Expand Down Expand Up @@ -472,9 +465,6 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) {

// Pool-specific defaults that depend upon OrchestratorProfile defaults
for _, profile := range cs.Properties.AgentPoolProfiles {
if cs.Properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku == StandardLoadBalancerSku {
cs.Properties.OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB = to.BoolPtr(DefaultExcludeMasterFromStandardLB)
}
// configure the subnets if not in custom VNET
if cs.Properties.MasterProfile != nil && !cs.Properties.MasterProfile.IsCustomVNET() {
subnetCounter := 0
Expand Down
16 changes: 8 additions & 8 deletions pkg/api/defaults_test.go
Expand Up @@ -2277,9 +2277,9 @@ func TestSetVMSSDefaultsAndZones(t *testing.T) {
t.Fatalf("MasterProfile.HasAvailabilityZones did not have the expected return, got %t, expected %t",
properties.MasterProfile.HasAvailabilityZones(), false)
}
if properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku != DefaultLoadBalancerSku {
if properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku != StandardLoadBalancerSku {
t.Fatalf("OrchestratorProfile.KubernetesConfig.LoadBalancerSku did not have the expected configuration, got %s, expected %s",
properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, DefaultLoadBalancerSku)
properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, StandardLoadBalancerSku)
}
// masters with VMSS and zones
mockCS = getMockBaseContainerService("1.12.0")
Expand Down Expand Up @@ -2324,9 +2324,9 @@ func TestSetVMSSDefaultsAndZones(t *testing.T) {
t.Fatalf("AgentPoolProfiles[0].HasAvailabilityZones did not have the expected return, got %t, expected %t",
properties.AgentPoolProfiles[0].HasAvailabilityZones(), false)
}
if properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku != DefaultLoadBalancerSku {
if properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku != StandardLoadBalancerSku {
t.Fatalf("OrchestratorProfile.KubernetesConfig.LoadBalancerSku did not have the expected configuration, got %s, expected %s",
properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, DefaultLoadBalancerSku)
properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, StandardLoadBalancerSku)
}
// agents with VMSS and zones
mockCS = getMockBaseContainerService("1.13.12")
Expand Down Expand Up @@ -3690,7 +3690,7 @@ func TestDefaultLoadBalancerSKU(t *testing.T) {
MasterProfile: &MasterProfile{},
},
},
expected: BasicLoadBalancerSku,
expected: StandardLoadBalancerSku,
},
{
name: "basic",
Expand All @@ -3709,7 +3709,7 @@ func TestDefaultLoadBalancerSKU(t *testing.T) {
expected: BasicLoadBalancerSku,
},
{
name: "default",
name: "basic using const",
cs: ContainerService{
Properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
Expand All @@ -3725,7 +3725,7 @@ func TestDefaultLoadBalancerSKU(t *testing.T) {
expected: BasicLoadBalancerSku,
},
{
name: "default",
name: "standard",
cs: ContainerService{
Properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
Expand All @@ -3741,7 +3741,7 @@ func TestDefaultLoadBalancerSKU(t *testing.T) {
expected: StandardLoadBalancerSku,
},
{
name: "default",
name: "standard using const",
cs: ContainerService{
Properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/mocks.go
Expand Up @@ -87,7 +87,7 @@ func CreateMockContainerService(containerServiceName, orchestratorVersion string
EtcdVersion: DefaultEtcdVersion,
MobyVersion: DefaultMobyVersion,
ContainerdVersion: DefaultContainerdVersion,
LoadBalancerSku: DefaultLoadBalancerSku,
LoadBalancerSku: BasicLoadBalancerSku,
KubeletConfig: make(map[string]string),
ControllerManagerConfig: make(map[string]string),
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
Expand Down
3 changes: 3 additions & 0 deletions pkg/engine/armvariables_test.go
Expand Up @@ -41,6 +41,9 @@ func TestK8sVars(t *testing.T) {
},
OrchestratorProfile: &api.OrchestratorProfile{
OrchestratorType: api.Kubernetes,
KubernetesConfig: &api.KubernetesConfig{
LoadBalancerSku: api.BasicLoadBalancerSku,
},
},
LinuxProfile: &api.LinuxProfile{},
AgentPoolProfiles: []*api.AgentPoolProfile{
Expand Down
6 changes: 1 addition & 5 deletions pkg/engine/testdata/mastersonly/mastersonly.json
Expand Up @@ -3,11 +3,7 @@
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.13",
"kubernetesConfig": {
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true
}
"orchestratorRelease": "1.13"
},
"masterProfile": {
"count": 3,
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/virtualmachinescalesets_test.go
Expand Up @@ -429,7 +429,7 @@ func TestCreateAgentVMSS(t *testing.T) {

// Now Test AgentVMSS with windows
// Restore LoadBalancerSku back to default and provide LoadBalancerBackendAddressPoolIDs
cs.Properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = api.DefaultLoadBalancerSku
cs.Properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = api.BasicLoadBalancerSku
cs.Properties.AgentPoolProfiles[0].LoadBalancerBackendAddressPoolIDs = []string{"/subscriptions/123/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/mySLB/backendAddressPools/mySLBBEPool"}
cs.Properties.AgentPoolProfiles[0].OSType = "Windows"
cs.Properties.AgentPoolProfiles[0].AcceleratedNetworkingEnabledWindows = to.BoolPtr(true)
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/test_cluster_configs/everything.json
Expand Up @@ -58,9 +58,7 @@
"name": "rescheduler",
"enabled": true
}
],
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true
]
}
},
"masterProfile": {
Expand Down
6 changes: 1 addition & 5 deletions test/e2e/test_cluster_configs/zones.json
Expand Up @@ -6,11 +6,7 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"kubernetesConfig": {
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true
}
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 3,
Expand Down