Skip to content

Commit

Permalink
Add instruction for no downtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Menezes committed Oct 27, 2020
1 parent 627ba72 commit 9bd0a7a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions docs/releases/1.19-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ has been updated by a newer version of kops unless it is given the `--allow-kops

* See note about [Openstack Cinder plugin](#openstack-cinder-plugin) above.

* Terraform users, in order to prevent downtime you will have to remove the state of the existing ELB attatchments from your terraform state file. This is due to us migrating to setting the loadbalancer attatchment when defining the ASG resource. The migration was required due to a bug described in #9913.

To prevent downtime, follow these steps with the new version of Kops:
```
kops update cluster --target terraform ...
terraform plan
terraform state list | grep aws_autoscaling_attachment | xargs -L1 terraform state rm
terraform plan
# Ensure these resources are no longer being destroyed and recreated
terraform apply
```

* If you are using Terraform with an additional .tf file and using "aws_autoscaling_attachment" to attach additional Load Balancers or ALB/NLB Target Groups you'll need to migrate to [attaching them through the InstanceGroup spec instead](https://kops.sigs.k8s.io/instance_groups/#externalloadbalancers).

# Deprecations
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/awsmodel/autoscalinggroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (b *AutoscalingGroupModelBuilder) buildAutoScalingGroupTask(c *fi.ModelBuil
}

if extLB.TargetGroupARN != nil {
t.TargetGroupARNs = append(t.TargetGroupARNs, &awstasks.TargetGroup{Name: extLB.TargetGroupARN, ARN: extLB.TargetGroupARN})
t.TargetGroups = append(t.TargetGroups, &awstasks.TargetGroup{Name: extLB.TargetGroupARN, ARN: extLB.TargetGroupARN})
}
}

Expand Down
12 changes: 6 additions & 6 deletions upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ type AutoscalingGroup struct {
SuspendProcesses *[]string
// Tags is a collection of keypairs to apply to the node on launch
Tags map[string]string
// TargetGroupARNs is a list of ALB/NLB target group ARNs to add to the autoscaling group
TargetGroupARNs []*TargetGroup
// TargetGroups is a list of ALB/NLB target group ARNs to add to the autoscaling group
TargetGroups []*TargetGroup
}

var _ fi.CompareWithID = &AutoscalingGroup{}
Expand Down Expand Up @@ -121,7 +121,7 @@ func (e *AutoscalingGroup) Find(c *fi.Context) (*AutoscalingGroup, error) {
}

for _, tg := range g.TargetGroupARNs {
actual.TargetGroupARNs = append(actual.TargetGroupARNs, &TargetGroup{ARN: aws.String(*tg)})
actual.TargetGroups = append(actual.TargetGroups, &TargetGroup{ARN: aws.String(*tg)})
}

if g.VPCZoneIdentifier != nil {
Expand Down Expand Up @@ -280,7 +280,7 @@ func (v *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos
request.LoadBalancerNames = append(request.LoadBalancerNames, k.GetName())
}

for _, tg := range e.TargetGroupARNs {
for _, tg := range e.TargetGroups {
request.TargetGroupARNs = append(request.TargetGroupARNs, tg.ARN)
}

Expand Down Expand Up @@ -787,7 +787,7 @@ func (_ *AutoscalingGroup) RenderTerraform(t *terraform.TerraformTarget, a, e, c
}
terraform.SortLiterals(tf.LoadBalancers)

for _, tg := range e.TargetGroupARNs {
for _, tg := range e.TargetGroups {
tf.TargetGroupARNs = append(tf.TargetGroupARNs, tg.TerraformLink())
}
terraform.SortLiterals(tf.TargetGroupARNs)
Expand Down Expand Up @@ -1023,7 +1023,7 @@ func (_ *AutoscalingGroup) RenderCloudformation(t *cloudformation.Cloudformation
cf.LoadBalancerNames = append(cf.LoadBalancerNames, k.CloudformationLink())
}

for _, tg := range e.TargetGroupARNs {
for _, tg := range e.TargetGroups {
cf.TargetGroupARNs = append(cf.TargetGroupARNs, tg.CloudformationLink())
}

Expand Down

0 comments on commit 9bd0a7a

Please sign in to comment.