Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions machine/v1beta1/types_gcpprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const (
RestartPolicyNever GCPRestartPolicyType = "Never"
)

// GCPProvisioningModelType is a type representing acceptable values for ProvisioningModel field in GCPMachineProviderSpec
type GCPProvisioningModelType string

const (
// GCPSpotInstance enables the GCP instances as spot instances which provide significant cost savings but may be preempted by Google Cloud Platform when resources are needed elsewhere.
GCPSpotInstance GCPProvisioningModelType = "Spot"
)

// SecureBootPolicy represents the secure boot configuration for the GCP machine.
type SecureBootPolicy string

Expand Down Expand Up @@ -129,6 +137,14 @@ type GCPMachineProviderSpec struct {
// preemptible indicates if created instance is preemptible.
// +optional
Preemptible bool `json:"preemptible,omitempty"`
// provisioningModel is an optional field that determines the provisioning model for the GCP machine instance.
// Valid values are "Spot" and omitted.
// When set to Spot, the instance runs as a Google Cloud Spot instance which provides significant cost savings but may be preempted by Google Cloud Platform when resources are needed elsewhere.
// When omitted, the machine will be provisioned as a standard on-demand instance.
// This field cannot be used together with the preemptible field.
// +optional
// +kubebuilder:validation:Enum=Spot
ProvisioningModel GCPProvisioningModelType `json:"provisioningModel,omitempty"`
// onHostMaintenance determines the behavior when a maintenance event occurs that might cause the instance to reboot.
// This is required to be set to "Terminate" if you want to provision machine with attached GPUs.
// Otherwise, allowed values are "Migrate" and "Terminate".
Expand Down
1 change: 1 addition & 0 deletions machine/v1beta1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -22911,6 +22911,10 @@
"description": "projectID is the project in which the GCP machine provider will create the VM.",
"type": "string"
},
"provisioningModel": {
"description": "provisioningModel is an optional field that determines the provisioning model for the GCP machine instance. Valid values are \"Spot\" and omitted. When set to Spot, the instance runs as a Google Cloud Spot instance which provides significant cost savings but may be preempted by Google Cloud Platform when resources are needed elsewhere. When omitted, the machine will be provisioned as a standard on-demand instance. This field cannot be used together with the preemptible field.",
"type": "string"
},
"region": {
"description": "region is the region in which the GCP machine provider will create the VM.",
"type": "string",
Expand Down