Skip to content

Commit 06d98ae

Browse files
committed
Added AWS dedicated host support
1 parent 230d0e0 commit 06d98ae

File tree

6 files changed

+205
-3
lines changed

6 files changed

+205
-3
lines changed

features/features.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ var (
753753
mustRegister()
754754

755755
FeatureGateAWSDedicatedHosts = newFeatureGate("AWSDedicatedHosts").
756-
reportProblemsToJiraComponent("Installer").
757-
contactPerson("faermanj").
756+
reportProblemsToJiraComponent("splat").
757+
contactPerson("rvanderp3").
758758
productScope(ocpSpecific).
759759
enhancementPR("https://github.com/openshift/enhancements/pull/1781").
760760
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).

machine/v1beta1/types_awsprovider.go

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ 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+
// dedicatedHost configures placement on AWS Dedicated Hosts.
112+
// When omitted, the instance is not constrained to a dedicated host.
113+
// If hostAffinity is set to "Host", a host ID must be provided at dedicatedHost.host.hostID.
114+
// If hostAffinity is set to "AnyAvailable", dedicatedHost.host must be omitted.
115+
// If hostAffinity is omitted and host.hostID is set, the instance starts on that specific host.
116+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
117+
// +optional
118+
DedicatedHost *DedicatedHost `json:"dedicatedHost,omitempty"`
110119
}
111120

112121
// BlockDeviceMappingSpec describes a block device mapping
@@ -355,3 +364,46 @@ const (
355364
// When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
356365
MarketTypeCapacityBlock MarketType = "CapacityBlock"
357366
)
367+
368+
type DedicatedHost struct {
369+
// hostAffinity selects how the instance is placed on a dedicated host.
370+
// Valid values are "AnyAvailable", "Host", and omitted.
371+
// - AnyAvailable: the platform selects any available dedicated host; do not set host.
372+
// - Host: the instance must run on a specific host; set host.hostID.
373+
// - omitted: if host.hostID is set, the instance runs on that specific host; otherwise no host constraint is applied.
374+
// When hostAffinity is set, host.hostID is required for "Host" and must be omitted for "AnyAvailable".
375+
// +kubebuilder:validation:MaxLength=64
376+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
377+
// +optional
378+
HostAffinity *HostAffinity `json:"hostAffinity,omitempty"`
379+
380+
// host specifies a particular dedicated host when required by hostAffinity or when
381+
// hostAffinity is omitted and you want to target a specific host.
382+
// Must be omitted when hostAffinity is "AnyAvailable".
383+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
384+
// +optional
385+
Host *Host `json:"host,omitempty"`
386+
}
387+
388+
// HostAffinity selects how an instance should be placed on AWS Dedicated Hosts.
389+
type HostAffinity string
390+
391+
const (
392+
// HostAffinityAnyAvailable lets the platform select any available dedicated host.
393+
HostAffinityAnyAvailable HostAffinity = "AnyAvailable"
394+
395+
// HostAffinityHost requires specifying a particular host via dedicatedHost.host.hostID.
396+
HostAffinityHost HostAffinity = "Host"
397+
)
398+
399+
type Host struct {
400+
// hostID identifies the AWS Dedicated Host on which the instance must run.
401+
// Use this when hostAffinity is "Host" or when hostAffinity is omitted and you want a specific host.
402+
// The value must start with "h-" followed by 17 lowercase hexadecimal characters (0-9 and a-f).
403+
// Maximum length is 19 characters.
404+
// +kubebuilder:validation:XValidation:rule="self == null || self.matches('^h-[0-9a-f]{17}$')",message="hostID must start with 'h-' followed by 17 lowercase hexadecimal characters (0-9 and a-f)"
405+
// +kubebuilder:validation:MaxLength=19
406+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
407+
// +optional
408+
HostID *string `json:"hostID,omitempty"`
409+
}

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 52 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: 18 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: 55 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22039,6 +22039,10 @@
2203922039
"description": "credentialsSecret is a reference to the secret with AWS credentials. Otherwise, defaults to permissions provided by attached IAM role where the actuator is running.",
2204022040
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
2204122041
},
22042+
"dedicatedHost": {
22043+
"description": "dedicatedHost configures placement on AWS Dedicated Hosts. When omitted, the instance is not constrained to a dedicated host. If hostAffinity is set to \"Host\", a host ID must be provided at dedicatedHost.host.hostID. If hostAffinity is set to \"AnyAvailable\", dedicatedHost.host must be omitted. If hostAffinity is omitted and host.hostID is set, the instance starts on that specific host.",
22044+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.DedicatedHost"
22045+
},
2204222046
"deviceIndex": {
2204322047
"description": "deviceIndex is the index of the device on the instance for the network interface attachment. Defaults to 0.",
2204422048
"type": "integer",
@@ -22622,6 +22626,19 @@
2262222626
}
2262322627
}
2262422628
},
22629+
"com.github.openshift.api.machine.v1beta1.DedicatedHost": {
22630+
"type": "object",
22631+
"properties": {
22632+
"host": {
22633+
"description": "host specifies a particular dedicated host when required by hostAffinity or when hostAffinity is omitted and you want to target a specific host. Must be omitted when hostAffinity is \"AnyAvailable\".",
22634+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.Host"
22635+
},
22636+
"hostAffinity": {
22637+
"description": "hostAffinity selects how the instance is placed on a dedicated host. Valid values are \"AnyAvailable\", \"Host\", and omitted. - AnyAvailable: the platform selects any available dedicated host; do not set host. - Host: the instance must run on a specific host; set host.hostID. - omitted: if host.hostID is set, the instance runs on that specific host; otherwise no host constraint is applied. When hostAffinity is set, host.hostID is required for \"Host\" and must be omitted for \"AnyAvailable\".",
22638+
"type": "string"
22639+
}
22640+
}
22641+
},
2262522642
"com.github.openshift.api.machine.v1beta1.DiskEncryptionSetParameters": {
2262622643
"description": "DiskEncryptionSetParameters is the disk encryption set properties",
2262722644
"type": "object",
@@ -23092,6 +23109,15 @@
2309223109
}
2309323110
}
2309423111
},
23112+
"com.github.openshift.api.machine.v1beta1.Host": {
23113+
"type": "object",
23114+
"properties": {
23115+
"hostID": {
23116+
"description": "hostID identifies the AWS Dedicated Host on which the instance must run. Use this when hostAffinity is \"Host\" or when hostAffinity is omitted and you want a specific host. The value must start with \"h-\" followed by 17 lowercase hexadecimal characters (0-9 and a-f). Maximum length is 19 characters.",
23117+
"type": "string"
23118+
}
23119+
}
23120+
},
2309523121
"com.github.openshift.api.machine.v1beta1.Image": {
2309623122
"description": "Image is a mirror of azure sdk compute.ImageReference",
2309723123
"type": "object",

0 commit comments

Comments
 (0)