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

Added Launch Template support for instance interruption behavior #9024

Merged
merged 9 commits into from
May 17, 2020

Conversation

tomesink
Copy link
Contributor

ref: #8809

Updated Launch Template with spot instance interruption behavior

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @tomesm. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2020
@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Apr 29, 2020
@hakman
Copy link
Member

hakman commented Apr 29, 2020

Very nice! You many need to run hack/update-expected.sh to fix tests.
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2020
Fixed indentation in terraform test template
@tomesink
Copy link
Contributor Author

/retest

try to fix wrong indentation again
@rifelpet
Copy link
Member

rifelpet commented May 1, 2020

This looks better now! I had to commit a change to your branch but the tests are now passing. one last thing is that I think launchtemplate_target_api.go needs to be updated as well. that way users with --target direct will be able to use the field. It should just be a matter of adding the new field to the RenderAWS and Find functions.

@tomesink
Copy link
Contributor Author

tomesink commented May 5, 2020

@rifelpet Thanks for removing the trailing space.

Before I commit anything I just want to be sure If I understand it right.

For RenderAWS for example I believe this must be added under InstanceMarketOptions, am I right?

Screenshot 2020-05-05 at 10 42 28

@rifelpet
Copy link
Member

rifelpet commented May 5, 2020

InstanceInterruptionBehavior would go in the LaunchTemplateSpotMarketOptionsRequest struct. The RenderAWS functions all use the types defined in the AWS SDK, so you can see the fields there:

https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#LaunchTemplateSpotMarketOptionsRequest

@tomesink
Copy link
Contributor Author

tomesink commented May 6, 2020

@rifelpet well, I am adding it to the LaunchTemplateSpotMarketOptionsRequest struct... and this struct is part of LaunchTemplateInstanceMarketOptionsRequest which is, based on my understanding, needed to create InstanceMarketOptions under RequestLaunchTemplateData struct.

So I am not sure what I am doing wrong here :)

@rifelpet
Copy link
Member

rifelpet commented May 6, 2020

everything you said sounds correct. can you push the commit here so we can take a look at any errors?

Added InstanceInterruptionBehavior to RenderAWS and Find. Fixed typo in instancegroups
pkg/apis/kops/instancegroup.go Outdated Show resolved Hide resolved
pkg/apis/kops/v1alpha2/instancegroup.go Outdated Show resolved Hide resolved
upup/pkg/fi/cloudup/awstasks/launchtemplate.go Outdated Show resolved Hide resolved
Martin Tomes and others added 4 commits May 8, 2020 22:49
Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
@tomesink tomesink requested a review from johngmyers May 10, 2020 11:13
@rifelpet
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet, tomesm

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 17, 2020
@rifelpet
Copy link
Member

/retest

1 similar comment
@rifelpet
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit bda2a15 into kubernetes:master May 17, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants