-
Notifications
You must be signed in to change notification settings - Fork 525
chore: force external cloud provider for Kubernetes v1.21+ on Azure Stack Hub #4849
Changes from all commits
01171b0
fe5439d
c1529f3
75c8340
37448ab
c1c18ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,16 @@ func (cs *ContainerService) setComponentsConfig(isUpgrade bool) { | |
} | ||
} | ||
|
||
// Ensure cloud-controller-manager is enabled on appropriate upgrades for Azure Stack cloud | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
if isUpgrade && | ||
cs.Properties.IsAzureStackCloud() && | ||
to.Bool(cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager) { | ||
// Force enabling cloud-controller-manager | ||
if i := GetComponentsIndexByName(kubernetesConfig.Components, common.CloudControllerManagerComponentName); i > -1 { | ||
kubernetesConfig.Components[i] = defaultCloudControllerManagerComponentConfig | ||
} | ||
} | ||
|
||
for _, component := range defaultComponents { | ||
synthesizeComponentsConfig(kubernetesConfig.Components, component, isUpgrade) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,10 @@ func (cs *ContainerService) setKubeletConfig(isUpgrade bool) { | |
// if upgrade, force default "--pod-infra-container-image" value | ||
cs.Properties.MasterProfile.KubernetesConfig.KubeletConfig["--pod-infra-container-image"] = o.KubernetesConfig.KubeletConfig["--pod-infra-container-image"] | ||
} | ||
//Ensure cloud-provider setting | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this, this is already being taken care of in L152-L154 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to ensure the KubeletConfig in MasterProfile get updated when we upgrade from a in-tree cloud-provider cluster to a external cloud-provider. Without this line, the previous value for this field will not get overwritten. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O.K., thanks for clarifying |
||
if to.Bool(o.KubernetesConfig.UseCloudControllerManager) { | ||
cs.Properties.MasterProfile.KubernetesConfig.KubeletConfig["--cloud-provider"] = "external" | ||
} | ||
setMissingKubeletValues(cs.Properties.MasterProfile.KubernetesConfig, o.KubernetesConfig.KubeletConfig) | ||
addDefaultFeatureGates(cs.Properties.MasterProfile.KubernetesConfig.KubeletConfig, o.OrchestratorVersion, "", "") | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,6 +300,10 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error { | |
} | ||
|
||
if a.IsAzureStackCloud() { | ||
if common.IsKubernetesVersionGe(a.OrchestratorProfile.OrchestratorVersion, "1.21.0") && !to.Bool(o.KubernetesConfig.UseCloudControllerManager) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This validation happens before defaults enforcement, so this is going to throw an error every time a user tries to create a cluster with an empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's what we want. We want users to add this |
||
return errors.New("useCloudControllerManager should be set to true for Kubernetes v1.21+ clusters on Azure Stack Hub") | ||
} | ||
|
||
if to.Bool(o.KubernetesConfig.UseInstanceMetadata) { | ||
return errors.New("useInstanceMetadata shouldn't be set to true as feature not yet supported on Azure Stack") | ||
} | ||
|
@@ -809,7 +813,7 @@ func (a *Properties) validateAddons(isUpdate bool) error { | |
// Validation for addons if they are disabled | ||
switch addon.Name { | ||
case "cloud-node-manager": | ||
if a.ShouldEnableAzureCloudAddon(addon.Name) { | ||
if a.ShouldEnableAzureCloudAddon(addon.Name) && !a.IsAzureStackCloud() { | ||
minVersion := "1.16.0" | ||
if a.HasWindows() { | ||
minVersion = "1.18.0" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check for
to.Bool(cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager) && common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.21.0"
?The UseCCM flag is overridden already and supported version list starts on 1.21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming that
upgrade.go
is executed firstThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, upgrade.go executed first, I will remove the check for k8s version