Merge pull request #10961 from spotinst/fix-lb-attachment

Spotinst: Don't skip LB attachments when SpotinstHybrid is enabled
This commit is contained in:
Kubernetes Prow Robot 2021-03-01 08:29:26 -08:00 committed by GitHub
commit c83d2346a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -428,10 +428,11 @@ func (b *AutoscalingGroupModelBuilder) buildAutoScalingGroupTask(c *fi.ModelBuil
t.LoadBalancers = []*awstasks.ClassicLoadBalancer{}
t.TargetGroups = []*awstasks.TargetGroup{}
// When Spotinst Elastigroups are used, there is no need to create
// a separate task for the attachment of the load balancer since this
// is already done as part of the Elastigroup's creation, if needed.
if !featureflag.Spotinst.Enabled() {
// Spotinst handles load balancer attachments internally, so there's no
// need to create separate attachments for both managed (+Spotinst) and
// hybrid (+SpotinstHybrid) instance groups.
if !featureflag.Spotinst.Enabled() ||
(featureflag.SpotinstHybrid.Enabled() && !spotinstmodel.HybridInstanceGroup(ig)) {
if b.UseLoadBalancerForAPI() && ig.Spec.Role == kops.InstanceGroupRoleMaster {
if b.UseNetworkLoadBalancer() {
t.TargetGroups = append(t.TargetGroups, b.LinkToTargetGroup("tcp"))