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

Spotinst: New hybrid integration mode #7252

Merged
merged 2 commits into from
May 23, 2020

Conversation

liranp
Copy link
Contributor

@liranp liranp commented Jul 15, 2019

Description

This PR allows users to gradually integrate with Spotinst.

When the Spotinst feature flag is toggled on (export KOPS_FEATURE_FLAGS="+Spotinst"), kops manages all instance groups through the Spotinst API using both Spotinst Elastigroup and Spotinst Ocean.

The new hybrid integration mode allows users to continue managing their instance groups through AWS Auto Scaling Groups, except for specific instance groups labeled with a predefined metadata label.

Usage

  1. Toggle on the hybrid integration feature flag:
export KOPS_FEATURE_FLAGS="+Spotinst,SpotinstHybrid"
  1. Create a new instance group or update an existing one:
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  labels:
    ...
    spotinst.io/hybrid: "true"
    ...
spec:
  ...

@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 Jul 15, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @liranp. 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 Jul 15, 2019
@rdrgmnzs
Copy link
Contributor

/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 Jul 17, 2019
@@ -34,6 +33,10 @@ import (
)

const (
// InstanceGroupLabelManaged is the metadata label used on the instance
// group to specify that the Spotinst provider should be used to upon creation.
InstanceGroupLabelManaged = "spotinst.io/managed"
Copy link
Member

Choose a reason for hiding this comment

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

This is a cool idea. One thing we could also do (with the move to adopt cluster-api), is to actually create a "provider" or "manager" or "strategy" field on the InstanceGroup. My personal choice would be provider, but I don't have strong feelings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree. It'd be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, do you think we should change the metadata label to spotinst.io/hybrid: "true" (instead of spotinst.io/managed: "true") so it will better match the feature flag?

Copy link
Contributor

Choose a reason for hiding this comment

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

I do like the idea of matching the feature flag there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, we already have customers that use this feature using a custom build of kops and we prefer to not introduce a breaking change by renaming the label. So, we've changed the implementation to support both cases.

AWSModelContext: awsModelContext,
}

spotinstModelBuilder := &spotinstmodel.InstanceGroupModelBuilder{
Copy link
Member

Choose a reason for hiding this comment

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

Moving this outside the featureflag looks scary, but it's fine :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, fixed.

upup/pkg/fi/cloudup/awsup/aws_cloud.go Show resolved Hide resolved
upup/pkg/fi/cloudup/awsup/aws_cloud.go Show resolved Hide resolved
@justinsb
Copy link
Member

Looks good. One query on the deletion logic.

cluster-api is also going to have similar switching of behaviour, so we could define a field on the InstanceGroup that switches how an instancegroup is created (AWS ASG vs SpotInst vs cluster-api). But that doesn't need to block this PR.

@liranp
Copy link
Contributor Author

liranp commented Jul 21, 2019

@justinsb Thank you so much! I'd love to hear your opinion about changing the metadata label. Not sure which one is better.

@liranp
Copy link
Contributor Author

liranp commented Aug 5, 2019

@justinsb Sorry to bother you, but can you please go over this? Thanks!

@liranp
Copy link
Contributor Author

liranp commented Sep 4, 2019

Anyone? Thanks!

@liranp
Copy link
Contributor Author

liranp commented Oct 2, 2019

Bumping... anyone? Thanks.

@chrisz100
Copy link
Contributor

/retest

@liranp liranp force-pushed the feature-spotinst-hybrid branch 3 times, most recently from 1ca8767 to 9df66ec Compare October 29, 2019 14:25
@liranp liranp force-pushed the feature-spotinst-hybrid branch 2 times, most recently from cb4b21e to d1d4152 Compare November 7, 2019 17:47
@liranp
Copy link
Contributor Author

liranp commented Nov 7, 2019

/assign @rdrgmnzs

@liranp
Copy link
Contributor Author

liranp commented Nov 24, 2019

Bumping... anyone? Thanks.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 22, 2019
@johngmyers
Copy link
Member

/retest

@liranp
Copy link
Contributor Author

liranp commented Jan 18, 2020

Bumping... anyone? Thanks.

@bycEEE
Copy link
Contributor

bycEEE commented Feb 21, 2020

Bump as well, would like to see this in the official binary instead of using a custom one.

@k8s-ci-robot
Copy link
Contributor

@liranp: you cannot LGTM your own PR.

In response to this:

/approve
/lgtm

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.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 23, 2020
@k8s-ci-robot k8s-ci-robot added area/provider/aws Issues or PRs related to aws provider and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 23, 2020
@liranp
Copy link
Contributor Author

liranp commented May 23, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 23, 2020
@rifelpet
Copy link
Member

this looks good to me, sorry for the delay!
/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 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 23, 2020
@k8s-ci-robot k8s-ci-robot merged commit af2d6b1 into kubernetes:master May 23, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone May 23, 2020
@liranp
Copy link
Contributor Author

liranp commented May 23, 2020

Thank you so much, @rifelpet!

@liranp liranp deleted the feature-spotinst-hybrid branch May 23, 2020 19:17
@estahn
Copy link
Contributor

estahn commented May 23, 2020

@liranp Will you provide documentation?

@liranp
Copy link
Contributor Author

liranp commented May 23, 2020

@estahn Already did that, see #9139. The documentation is available here.

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

10 participants