-
Notifications
You must be signed in to change notification settings - Fork 200
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 support for Spot VMs #1313
Add support for Spot VMs #1313
Conversation
Hi @jwmay2012. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
14e2818
to
576b0db
Compare
/ok-to-test Thanks for working on this @jwmay2012! |
@@ -402,6 +402,16 @@ func (m *MachineScope) InstanceSpec(log logr.Logger) *compute.Instance { | |||
Preemptible: m.GCPMachine.Spec.Preemptible, | |||
}, | |||
} | |||
if m.GCPMachine.Spec.ProvisioningModel != nil { |
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.
Should we also explicitly set the ProvisioningModel
to Standard
when not null or is it implicitly set by GCP?
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 do believe GCP defaults to STANDARD
. All documentation seems to be focused around specifying SPOT
and otherwise ignoring the field.
I also figured it was lower risk to maintain the existing behavior when the field is not set, allowing the GCP default to continue to be used.
The CAPG book contains a section on using Preemptible VMs (book source files can be found here). Perhaps it makes sense to also document Spot VMs and what happens with each combination of |
Makes sense. I'll add the specifics of |
605ea38
to
1cd1566
Compare
1cd1566
to
9cec971
Compare
Tested combinations of |
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.
Thanks for working on this @jwmay2012
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.
/lgtm
/hold for another eye from @richardcase
/assing @richardcase
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cpanato, jwmay2012, salasberryfin 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 |
Also from my side: /lgtm And so lets /unhold |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support for GCP Spot VMs, which are distinct from
preemptible
vms. Spot VMs are newer.https://cloud.google.com/compute/docs/instances/spot
They no longer have a mandatory 24 hr limit.
Special notes for your reviewer:
Modeled PR after the addition of preemptible vms.
Documentation that specifies details on
provisioningModel
,SPOT
andSTANDARD
--https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#provisioning_model
https://cloud.google.com/compute/docs/instances/create-use-spot#create
Relevant docs about field logic--
TODOs:
No tests exist for preemptible vms. This change seems pretty simple and straight forward and doesn't cause any changes unless the new field is used.
Release note: