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

Commit

Permalink
chore: only warn about master stuff during create (#4057)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored Nov 20, 2020
1 parent cc2e826 commit fba3821
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
func (a *Properties) validateMasterProfile(isUpdate bool) error {
m := a.MasterProfile

if m.Count == 1 {
if m.Count == 1 && !isUpdate {
log.Warnf("Running only 1 control plane VM not recommended for production clusters, use 3 or 5 for control plane redundancy")
}
if m.IsVirtualMachineScaleSets() && m.VnetSubnetID != "" && m.FirstConsecutiveStaticIP != "" {
Expand All @@ -399,7 +399,9 @@ func (a *Properties) validateMasterProfile(isUpdate bool) error {
}

if m.IsVirtualMachineScaleSets() {
log.Warnf("Clusters with VMSS masters are not yet upgradable! You will not be able to upgrade your cluster until a future version of aks-engine!")
if !isUpdate {
log.Warnf("Clusters with VMSS masters are not yet upgradable! You will not be able to upgrade your cluster until a future version of aks-engine!")
}
e := validateVMSS(a.OrchestratorProfile, false, m.StorageProfile, a.HasWindows(), a.IsAzureStackCloud())
if e != nil {
return e
Expand Down
9 changes: 9 additions & 0 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3391,11 +3391,20 @@ func ExampleProperties_validateMasterProfile() {
})
cs := getK8sDefaultContainerService(false)
cs.Properties.MasterProfile.Count = 1
cs.Properties.MasterProfile.AvailabilityProfile = VirtualMachineScaleSets
cs.Properties.AgentPoolProfiles[0].AvailabilityProfile = VirtualMachineScaleSets
if err := cs.Properties.validateMasterProfile(false); err != nil {
log.Errorf("shouldn't error with 1 control plane VM, got %s", err.Error())
}

cs = getK8sDefaultContainerService(false)
cs.Properties.MasterProfile.Count = 1
if err := cs.Properties.validateMasterProfile(true); err != nil {
log.Errorf("shouldn't error with 1 control plane VM, got %s", err.Error())
}
// Output:
// level=warning msg="Running only 1 control plane VM not recommended for production clusters, use 3 or 5 for control plane redundancy"
// level=warning msg="Clusters with VMSS masters are not yet upgradable! You will not be able to upgrade your cluster until a future version of aks-engine!"
}

func ExampleProperties_validateZones() {
Expand Down

0 comments on commit fba3821

Please sign in to comment.