Skip to content

Commit b088b27

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

File tree

6 files changed

+71
-2
lines changed

6 files changed

+71
-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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ 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+
// +kubebuilder:validation:Pattern=`^h-[0-9a-f]{17}$`
114+
// +kubebuilder:validation:MaxLength=19
115+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
116+
// +optional
117+
HostID *string `json:"hostID,omitempty"`
118+
119+
// hostAffinity specifies the dedicated host affinity setting for the instance.
120+
// When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped.
121+
// When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host.
122+
// When HostAffinity is defined, HostID is required.
123+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
124+
// +optional
125+
HostAffinity *HostAffinity `json:"hostAffinity,omitempty"`
110126
}
111127

112128
// BlockDeviceMappingSpec describes a block device mapping
@@ -355,3 +371,22 @@ const (
355371
// When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
356372
MarketTypeCapacityBlock MarketType = "CapacityBlock"
357373
)
374+
375+
// HostAffinity describes the host affinity of an EC2 Instance
376+
// +kubebuilder:validation:Enum:=host;default;""
377+
// +kubebuilder:default=""
378+
type HostAffinity string
379+
380+
const (
381+
// HostAffinityUnspecified is a HostAffinity enum value
382+
// When set to default the instance is put on a host using the AWS default logic.
383+
HostAffinityUnspecified HostAffinity = ""
384+
385+
// HostAffinityDefault is a HostAffinity enum value
386+
// When set to default the instance is put on a host using the AWS default logic.
387+
HostAffinityDefault HostAffinity = "default"
388+
389+
// HostAffinityHost is a HostAffinity enum value
390+
// When set to host the instance runs on the specified host.
391+
HostAffinityHost HostAffinity = "host"
392+
)

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. 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 default, and you stop and restart the instance, it can be restarted on any available 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.",
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)