@@ -41,6 +41,7 @@ const (
41
41
DefaultMachinePoolIgnitionStorageType = IgnitionStorageTypeOptionUnencryptedUserData
42
42
)
43
43
44
+
44
45
// SecretBackend defines variants for backend secret storage.
45
46
type SecretBackend string
46
47
@@ -213,6 +214,10 @@ type AWSMachineSpec struct {
213
214
PlacementGroupPartition int64 `json:"placementGroupPartition,omitempty"`
214
215
215
216
// Tenancy indicates if instance should run on shared or single-tenant hardware.
217
+ // When Tenancy=host, AWS will attempt to find a suitable host from:
218
+ // - Preexisting allocated hosts that have auto-placement enabled
219
+ // - A specific host ID, if configured
220
+ // - Allocating a new dedicated host if DynamicHostAllocation is configured
216
221
// +optional
217
222
// +kubebuilder:validation:Enum:=default;dedicated;host
218
223
Tenancy string `json:"tenancy,omitempty"`
@@ -235,17 +240,27 @@ type AWSMachineSpec struct {
235
240
MarketType MarketType `json:"marketType,omitempty"`
236
241
237
242
// HostID specifies the Dedicated Host on which the instance must be started.
243
+ // This field is mutually exclusive with DynamicHostAllocation.
244
+ // +kubebuilder:validation:Pattern=`^h-[0-9a-f]{17}$`
238
245
// +optional
239
246
HostID * string `json:"hostID,omitempty"`
240
247
241
248
// HostAffinity specifies the dedicated host affinity setting for the instance.
242
- // When hostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
243
- // When hostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
249
+ // When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
250
+ // When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
244
251
// When HostAffinity is defined, HostID is required.
245
252
// +optional
246
253
// +kubebuilder:validation:Enum:=default;host
254
+ // +kubebuilder:default=default
247
255
HostAffinity * string `json:"hostAffinity,omitempty"`
248
256
257
+ // DynamicHostAllocation enables automatic allocation of a single dedicated host.
258
+ // This field is mutually exclusive with HostID and always allocates exactly one host.
259
+ // Cost effectiveness of allocating a single instance on a dedicated host may vary
260
+ // depending on the instance type and the region.
261
+ // +optional
262
+ DynamicHostAllocation * DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"`
263
+
249
264
// CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
250
265
// "Open": The instance may make use of open Capacity Reservations that match its AZ and InstanceType
251
266
// "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
@@ -255,6 +270,14 @@ type AWSMachineSpec struct {
255
270
CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"`
256
271
}
257
272
273
+ // DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation.
274
+ // This specification always allocates exactly one dedicated host per machine.
275
+ type DynamicHostAllocationSpec struct {
276
+ // Tags to apply to the allocated dedicated host.
277
+ // +optional
278
+ Tags map [string ]string `json:"tags,omitempty"`
279
+ }
280
+
258
281
// CloudInit defines options related to the bootstrapping systems where
259
282
// CloudInit is used.
260
283
type CloudInit struct {
@@ -432,6 +455,23 @@ type AWSMachineStatus struct {
432
455
// Conditions defines current service state of the AWSMachine.
433
456
// +optional
434
457
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
458
+
459
+ // DedicatedHostID tracks the dynamically allocated dedicated host ID.
460
+ // This field is populated when DynamicHostAllocation is used.
461
+ // +optional
462
+ DedicatedHostID * string `json:"dedicatedHostID,omitempty"`
463
+
464
+ // HostReleaseAttempts tracks the number of attempts to release the dedicated host.
465
+ // +optional
466
+ HostReleaseAttempts * int32 `json:"hostReleaseAttempts,omitempty"`
467
+
468
+ // LastHostReleaseAttempt tracks the timestamp of the last attempt to release the dedicated host.
469
+ // +optional
470
+ LastHostReleaseAttempt * metav1.Time `json:"lastHostReleaseAttempt,omitempty"`
471
+
472
+ // HostReleaseFailedReason tracks the reason for the last host release failure.
473
+ // +optional
474
+ HostReleaseFailedReason * string `json:"hostReleaseFailedReason,omitempty"`
435
475
}
436
476
437
477
// +kubebuilder:object:root=true
0 commit comments