Skip to content

Commit 1afaa6e

Browse files
committed
add ProvisioningModel to enable gcp spot instances
1 parent 588d549 commit 1afaa6e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

machine/v1beta1/types_gcpprovider.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ const (
2525
RestartPolicyNever GCPRestartPolicyType = "Never"
2626
)
2727

28+
// GCPProvisioningModelType is a type representing acceptable values for ProvisioningModel field in GCPMachineProviderSpec
29+
type GCPProvisioningModelType string
30+
31+
const (
32+
// GCPSpotInstance To enable the GCP instances as spot type.
33+
GCPSpotInstance GCPProvisioningModelType = "Spot"
34+
)
35+
2836
// SecureBootPolicy represents the secure boot configuration for the GCP machine.
2937
type SecureBootPolicy string
3038

@@ -129,6 +137,13 @@ type GCPMachineProviderSpec struct {
129137
// preemptible indicates if created instance is preemptible.
130138
// +optional
131139
Preemptible bool `json:"preemptible,omitempty"`
140+
// provisioningModel is used to enable GCP spot instances.
141+
// the only value supported is "Spot"
142+
// Cannot have preemptible enabled and be a GCP spot instance at the sametime
143+
// +kubebuilder:validation:MinLength=1
144+
// +kubebuilder:validation:MaxLength=32
145+
// +optional
146+
ProvisioningModel GCPProvisioningModelType `json:"provisioningModel,omitempty"`
132147
// onHostMaintenance determines the behavior when a maintenance event occurs that might cause the instance to reboot.
133148
// This is required to be set to "Terminate" if you want to provision machine with attached GPUs.
134149
// Otherwise, allowed values are "Migrate" and "Terminate".

0 commit comments

Comments
 (0)