-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use LaunchTemplate versions instead of timestamped LaunchTemplates #10151
Use LaunchTemplate versions instead of timestamped LaunchTemplates #10151
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bbbc5ba
to
bf79b86
Compare
/hold for feedback |
bf79b86
to
4328a00
Compare
4328a00
to
dcc7444
Compare
/test pull-kops-bazel-test |
/retest |
dcc7444
to
992b16d
Compare
992b16d
to
852c0e2
Compare
for _, configuration := range configurations { | ||
removals = append(removals, &deleteLaunchTemplate{lc: configuration}) | ||
if strings.HasPrefix(aws.StringValue(configuration.LaunchTemplateName), prefix) { |
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.
Why is this necessary? Wouldn't all the old launch templates be deleted as owned by the cluster but unreferenced by an ASG?
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.
There can be N previous LTs for each ASG. already unreferenced that should be deleted.
Maybe there's some mechanism that I'm missing.
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.
Looks like I misunderstood the Find
/ FindDeletions
mechanisms. I thought it would look for resources tagged as owned by the cluster and delete them if they're not expected.
} | ||
e.ID = output.LaunchTemplate.LaunchTemplateId | ||
} else { | ||
// TODO: Update the LaunchTemplate tags |
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 think implementing this might block merging.
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.
Hmm, already implemented it in 852c0e2 and seems to work without issues. Nothing actually reads these tags after creation, they are just used for deleting the LT when needed.
b1537a5
to
705fd35
Compare
/hold cancel |
705fd35
to
1d6a51a
Compare
/lgtm |
Thanks @johngmyers :) |
…-upstream-release-1.19 Automated cherry pick of #10151: Use LT versions instead of timestamped LTs
Historically, kOps used LaunchConfigurations for configuring AutoScalingGroups with the IG name as prefix and creation timestamp as suffix (
nodes-a.k8s.example.com-20200806091534
).Newer versions of kOps added the possibility of using LaunchTemplates for configuring AutoScalingGroups, as some features are not available for when using LaunchConfigurations. Even though LaunchTemplates allow versioning, kOps uses the same naming convention as for LaunchConfigurations, but having to deal with LaunchTemplateVersions also and generating many requests to the AWS API, as seen in #9806.
kOps 1.19 introduces LaunchTemplates as the default AutoScalingGroups configuration method and switching to versions should simplify things:
$Latest
LaunchTemplate versionCloudFormation output will not be affected by these changes.
Terraform output will change to using
name
instead ofname_prefix
(another leftover from the LaunchConfigurations days).