Skip to content
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

Add instance group option to use LaunchTemplate #8696

Closed
wants to merge 1 commit into from

Conversation

hakman
Copy link
Member

@hakman hakman commented Mar 8, 2020

As agreed during Office Hours, launch templates should move from experimental to an InstanceGroup option.

At the moment, the main reason to switch to launch templates would be to get tags for root volumes and other resources. Versions should also be explored, instead of creating a launch template on each update.

This should be merged before #8693 to see how those changes affect the launch templates.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 8, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hakman
To complete the pull request process, please assign chrislovecnm
You can assign the PR to them by writing /assign @chrislovecnm in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hakman
Copy link
Member Author

hakman commented Mar 8, 2020

enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
}

resource "aws_autoscaling_group" "nodes-launchtemplates-example-com" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ASG resource doesnt have the launch_template property that associates it with the aws_launch_template defined below.

https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#with-latest-version-of-launch-template

I know your other PR mentions that LT werent working at all, but it seems it only fixes CF, not TF. It may be out of scope for this PR but we should definitely fix that because it seems that launch templates wont work with terraform at all currently.

Side note: i'm hoping that #8648 will prevent this from happening again in the future, since I believe this would be caught during a terraform validate or terraform plan

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was the main problem with TF. The other PR should fix it with this:

} else if e.LaunchTemplate != nil {
tf.LaunchTemplate = &terraformAutoscalingLaunchTemplateSpecification{
LaunchTemplateID: e.LaunchTemplate.TerraformLink(),
Version: e.LaunchTemplate.VersionLink(),
}

@johngmyers
Copy link
Member

I don't remember that agreement; that comment must have passed under my radar.

What is the value in keeping support for launch configurations long-term? Wouldn't a better progression of the feature be to change the default of the feature flag and then later remove support for launch configurations?

With the launch templates code needing so many fixes this round, perhaps taking them out from under the feature flag should be deferred to kops 1.19.

@hakman
Copy link
Member Author

hakman commented Mar 8, 2020

@johngmyers this was the agreement at the Jan 31 meeting. I asked if the flag can be removed. The answer was that yes, because people are already using it in mixed instances. But, to be safe, first change it to instancegroup option, disabled by default.

There is no value in keeping support for launch configuration long term. We cannot remove them until we are sure that the upgrade for existing clusters is without issues.

Kops feature flags are hard to use and test. This is why it's best to move it to option for now and once we are comfortable, we can set it as default.

@hakman hakman requested a review from rifelpet March 8, 2020 17:26
@rifelpet
Copy link
Member

rifelpet commented Mar 8, 2020

One other benefit of using an API field rather than feature flag is it allows the cluster administrator to rollout the LC -> LT migration on a per-IG basis rather than all InstanceGroups at once. The downside is that the field's relevance is relatively short. At some point we'd want to have new clusters default to using LaunchTemplates and eventually consider having existing clusters migrated by default as well.

If we're looking for precedence for making this an API field, I think a comparable field would be the etcd Provider, it was primarily relevant during the etcd2/etcd3 migration but long term I don't see us needing to support the standalone value.

@johngmyers
Copy link
Member

The disadvantage to an API field is that it takes an extremely long time to remove.

Is there a particular reason an admin would want to rollout the migration on a per-IG basis? This doesn't seem like it should be as impactful as changing the etcd provider.

This isn't a strong objection; it just seems a bit overcomplicated and overly user visible.

@hakman
Copy link
Member Author

hakman commented Mar 10, 2020

/assign @justinsb

@hakman
Copy link
Member Author

hakman commented Mar 11, 2020

@justinsb Can you please check that this is as we agreed during office hours?

@hakman
Copy link
Member Author

hakman commented Mar 16, 2020

Closing in favour of #8758

@hakman hakman closed this Mar 16, 2020
@hakman hakman deleted the use-launch-tepmplate branch March 27, 2020 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants