@@ -79,6 +79,22 @@ const (
7979 ConfidentialComputePolicyTDX ConfidentialComputePolicy = "IntelTrustedDomainExtensions"
8080)
8181
82+ // GCPReservationAffinity describes the reservation affinity of the instance on GCP.
83+ type GCPReservationAffinity struct {
84+ // consumeReservationType indicates whether the instance should consume from any reservation or a specific reservation.
85+ // Valid values are "ANY_RESERVATION" and "SPECIFIC_RESERVATION".
86+ // +kubebuilder:validation:Enum=ANY_RESERVATION;SPECIFIC_RESERVATION
87+ ConsumeReservationType string `json:"consumeReservationType"`
88+ // key is the reservation key of the specific reservation to consume from.
89+ // Required if consumeReservationType is set to "SPECIFIC_RESERVATION".
90+ // +optional
91+ Key string `json:"key,omitempty"`
92+ // values is the list of reservation values of the specific reservation to consume from.
93+ // Required if consumeReservationType is set to "SPECIFIC_RESERVATION".
94+ // +optional
95+ Values []string `json:"values,omitempty"`
96+ }
97+
8298// GCPMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field
8399// for an GCP virtual machine. It is used by the GCP machine actuator to create a single Machine.
84100// Compatibility level 2: Stable within a major release for a minimum of 9 months or 3 minor releases (whichever is longer).
@@ -191,6 +207,10 @@ type GCPMachineProviderSpec struct {
191207 // +listMapKey=key
192208 // +optional
193209 ResourceManagerTags []ResourceManagerTag `json:"resourceManagerTags,omitempty"`
210+
211+ // reservationAffinity indicates the reservation for the VM.
212+ // +optional
213+ ReservationAffinity * GCPReservationAffinity `json:"reservationAffinity,omitempty"`
194214}
195215
196216// ResourceManagerTag is a tag to apply to GCP resources created for the cluster.
0 commit comments