Skip to content

Commit 9355a76

Browse files
committed
Added AWS dedicated host support
1 parent d394d8c commit 9355a76

File tree

6 files changed

+70
-2
lines changed

6 files changed

+70
-2
lines changed

features/features.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,8 @@ var (
772772
mustRegister()
773773

774774
FeatureGateAWSDedicatedHosts = newFeatureGate("AWSDedicatedHosts").
775-
reportProblemsToJiraComponent("Installer").
776-
contactPerson("faermanj").
775+
reportProblemsToJiraComponent("splat").
776+
contactPerson("rvanderp3").
777777
productScope(ocpSpecific).
778778
enhancementPR("https://github.com/openshift/enhancements/pull/1781").
779779
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).

machine/v1beta1/types_awsprovider.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@ type AWSMachineProviderConfig struct {
107107
// If this value is selected, capacityReservationID must be specified to identify the target reservation.
108108
// +optional
109109
MarketType MarketType `json:"marketType,omitempty"`
110+
111+
// hostID specifies the Dedicated Host on which the instance must be started.
112+
// This field is mutually exclusive with DynamicHostAllocation.
113+
// When set, the value must be a valid AWS Dedicated Host ID in the form
114+
// "h-" followed by 17 lowercase hexadecimal characters.
115+
// The maximum length is 19 characters, and the field may be omitted.
116+
// +kubebuilder:validation:XValidation:rule="self == null || self.matches('^h-[0-9a-f]{17}$')",message="hostID must match ^h-[0-9a-f]{17}$"
117+
// +kubebuilder:validation:MaxLength=19
118+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
119+
// +optional
120+
HostID *string `json:"hostID,omitempty"`
121+
122+
// hostAffinity specifies the dedicated host affinity setting for the instance.
123+
// Valid values are "AnyAvailable", "Host", and omitted.
124+
// When HostAffinity is set to "Host", an instance started onto a specific host always restarts on the same host if stopped.
125+
// When HostAffinity is set to "AnyAvailable", and you stop and restart the instance, it can be restarted on any available host.
126+
// When HostAffinity is omitted and HostID is defined, the instance is started onto the specified host.
127+
// When HostAffinity is defined, HostID is required.
128+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
129+
// +optional
130+
HostAffinity *HostAffinity `json:"hostAffinity,omitempty"`
110131
}
111132

112133
// BlockDeviceMappingSpec describes a block device mapping
@@ -355,3 +376,16 @@ const (
355376
// When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
356377
MarketTypeCapacityBlock MarketType = "CapacityBlock"
357378
)
379+
380+
// HostAffinity describes the host affinity of an EC2 Instance
381+
type HostAffinity string
382+
383+
const (
384+
// HostAffinityAnyAvailable is a HostAffinity enum value
385+
// When set to AnyAvailable the instance is put on a host using the AWS default logic.
386+
HostAffinityAnyAvailable HostAffinity = "AnyAvailable"
387+
388+
// HostAffinityHost is a HostAffinity enum value
389+
// When set to host the instance runs on the specified host.
390+
HostAffinityHost HostAffinity = "Host"
391+
)

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 10 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: 2 additions & 0 deletions
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: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21970,6 +21970,14 @@
2197021970
"format": "int64",
2197121971
"default": 0
2197221972
},
21973+
"hostAffinity": {
21974+
"description": "hostAffinity specifies the dedicated host affinity setting for the instance. Valid values are \"AnyAvailable\", \"Host\", and omitted. When HostAffinity is set to \"Host\", an instance started onto a specific host always restarts on the same host if stopped. When HostAffinity is set to \"AnyAvailable\", and you stop and restart the instance, it can be restarted on any available host. When HostAffinity is omitted and HostID is defined, the instance is started onto the specified host. When HostAffinity is defined, HostID is required.",
21975+
"type": "string"
21976+
},
21977+
"hostID": {
21978+
"description": "hostID specifies the Dedicated Host on which the instance must be started. This field is mutually exclusive with DynamicHostAllocation. When set, the value must be a valid AWS Dedicated Host ID in the form \"h-\" followed by 17 lowercase hexadecimal characters. The maximum length is 19 characters, and the field may be omitted.",
21979+
"type": "string"
21980+
},
2197321981
"iamInstanceProfile": {
2197421982
"description": "iamInstanceProfile is a reference to an IAM role to assign to the instance",
2197521983
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.AWSResourceReference"

0 commit comments

Comments
 (0)