Add instruction for no downtime

This commit is contained in:
Rodrigo Menezes 2020-10-26 18:11:46 -07:00
parent 627ba720a9
commit 9bd0a7aedb
3 changed files with 19 additions and 7 deletions

View File

@ -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

View File

@ -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})
}
}

View File

@ -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{}
@ -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 {
@ -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)
}
@ -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)
@ -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())
}