Skip to content

Commit c3844ee

Browse files
committed
Added support for legacy AWS dedicated hosts
1 parent 6ab113c commit c3844ee

File tree

5 files changed

+188
-18
lines changed

5 files changed

+188
-18
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ type HostPlacement struct {
435435
// affinity specifies the affinity setting for the instance.
436436
// Allowed values are AnyAvailable and DedicatedHost.
437437
// When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set.
438+
// When Affinity is set to DynamicHost, a dedicated host will be allocated and assigned to the instance and the instance will always restart on this host if stopped. In this scenario, the `dynamicHost` field must be set.
438439
// When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
439440
// When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.
440441
// +required
@@ -446,6 +447,12 @@ type HostPlacement struct {
446447
// +optional
447448
// +unionMember
448449
DedicatedHost *DedicatedHost `json:"dedicatedHost,omitempty"`
450+
451+
// dynamicHost enables automatic allocation of a single dedicated host.
452+
// This field is mutually exclusive with dedicatedHost and always allocates exactly one host.
453+
// +optional
454+
// +unionMember
455+
DynamicHostAllocation *DynamicHostAllocationSpec `json:"dynamicHost,omitempty"`
449456
}
450457

451458
// HostAffinity selects how an instance should be placed on AWS Dedicated Hosts.
@@ -458,6 +465,9 @@ const (
458465

459466
// HostAffinityDedicatedHost requires specifying a particular host via dedicatedHost.host.hostID.
460467
HostAffinityDedicatedHost HostAffinity = "DedicatedHost"
468+
469+
// HostAffinityDynamicHost requires specifying a host config in dynamicHost.
470+
HostAffinityDynamicHost HostAffinity = "DynamicHost"
461471
)
462472

463473
// DedicatedHost represents the configuration for the usage of dedicated host.
@@ -472,3 +482,11 @@ type DedicatedHost struct {
472482
// +required
473483
ID string `json:"id,omitempty"`
474484
}
485+
486+
// DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation.
487+
// This specification always allocates exactly one dedicated host per machine.
488+
type DynamicHostAllocationSpec struct {
489+
// Tags to apply to the allocated dedicated host.
490+
// +optional
491+
Tags map[string]string `json:"tags,omitempty"`
492+
}

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

machine/v1beta1/zz_generated.swagger_doc_generated.go

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 39 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)