Revert "Migrate to AWS CCM in k8s 1.24"

This reverts commit 56c054cda7.
This commit is contained in:
John Gardiner Myers 2021-11-12 22:07:18 -08:00
parent 561b562a65
commit 46e226d1ee
5 changed files with 2 additions and 34 deletions

View File

@ -650,8 +650,6 @@ type KubeControllerManagerConfig struct {
// EnableProfiling enables profiling via web interface host:port/debug/pprof/
EnableProfiling *bool `json:"enableProfiling,omitempty" flag:"profiling"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// CloudControllerManagerConfig is the configuration of the cloud controller
@ -679,8 +677,6 @@ type CloudControllerManagerConfig struct {
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// KubeSchedulerConfig is the configuration for the kube-scheduler

View File

@ -649,8 +649,6 @@ type KubeControllerManagerConfig struct {
// EnableProfiling enables profiling via web interface host:port/debug/pprof/
EnableProfiling *bool `json:"enableProfiling,omitempty" flag:"profiling"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// CloudControllerManagerConfig is the configuration of the cloud controller
@ -678,8 +676,6 @@ type CloudControllerManagerConfig struct {
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// KubeSchedulerConfig is the configuration for the kube-scheduler

View File

@ -647,8 +647,6 @@ type KubeControllerManagerConfig struct {
// EnableProfiling enables profiling via web interface host:port/debug/pprof/
EnableProfiling *bool `json:"enableProfiling,omitempty" flag:"profiling"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// CloudControllerManagerConfig is the configuration of the cloud controller
@ -676,8 +674,6 @@ type CloudControllerManagerConfig struct {
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// EnableLeaderMigration enables controller leader migration.
EnableLeaderMigration *bool `json:"enableLeaderMigration,omitempty" flag:"enable-leader-migration"`
}
// KubeSchedulerConfig is the configuration for the kube-scheduler

View File

@ -38,14 +38,6 @@ func (b *AWSCloudControllerManagerOptionsBuilder) BuildOptions(o interface{}) er
eccm := clusterSpec.ExternalCloudControllerManager
if kops.CloudProviderID(clusterSpec.CloudProvider) != kops.CloudProviderAWS {
return nil
}
if eccm == nil && b.IsKubernetesGTE("1.24") {
eccm = &kops.CloudControllerManagerConfig{}
}
if eccm == nil || kops.CloudProviderID(clusterSpec.CloudProvider) != kops.CloudProviderAWS {
return nil
}
@ -99,9 +91,5 @@ func (b *AWSCloudControllerManagerOptionsBuilder) BuildOptions(o interface{}) er
}
}
if b.IsKubernetesGTE("1.24") && b.IsKubernetesLT("1.25") {
eccm.EnableLeaderMigration = fi.Bool(true)
}
return nil
}

View File

@ -79,11 +79,7 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
kcm.ClusterName = b.ClusterName
switch kops.CloudProviderID(clusterSpec.CloudProvider) {
case kops.CloudProviderAWS:
if b.IsKubernetesGTE("1.24") {
kcm.CloudProvider = "external"
} else {
kcm.CloudProvider = "aws"
}
kcm.CloudProvider = "aws"
case kops.CloudProviderGCE:
kcm.CloudProvider = "gce"
@ -105,11 +101,7 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
return fmt.Errorf("unknown cloudprovider %q", clusterSpec.CloudProvider)
}
if clusterSpec.ExternalCloudControllerManager == nil {
if kcm.CloudProvider == "aws" && b.IsKubernetesGTE("1.23") {
kcm.EnableLeaderMigration = fi.Bool(true)
}
} else {
if clusterSpec.ExternalCloudControllerManager != nil {
kcm.CloudProvider = "external"
}