Skip to content

Commit aab9734

Browse files
committed
Added AWS dedicated host support
1 parent 595e66a commit aab9734

File tree

6 files changed

+198
-3
lines changed

6 files changed

+198
-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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ type AWSMachineProviderConfig struct {
114114
// If this value is selected, capacityReservationID must be specified to identify the target reservation.
115115
// +optional
116116
MarketType MarketType `json:"marketType,omitempty"`
117+
118+
// dedicatedHost configures placement on AWS Dedicated Hosts.
119+
// When omitted, the instance is not constrained to a dedicated host.
120+
// If hostAffinity is set to "Host", a host ID must be provided at dedicatedHost.host.hostID.
121+
// If hostAffinity is set to "AnyAvailable", dedicatedHost.host must be omitted.
122+
// If hostAffinity is omitted and host.hostID is set, the instance starts on that specific host.
123+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
124+
// +optional
125+
DedicatedHost *DedicatedHost `json:"dedicatedHost,omitempty"`
117126
}
118127

119128
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
@@ -393,3 +402,47 @@ const (
393402
// When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
394403
MarketTypeCapacityBlock MarketType = "CapacityBlock"
395404
)
405+
406+
type DedicatedHost struct {
407+
// hostAffinity specifies the dedicated host affinity setting for the instance.
408+
// When HostAffinity is set to Host, an instance started onto a specific host always restarts on the same host if stopped.
409+
// When HostAffinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
410+
// When HostAffinity is defined, Host is required.
411+
// The default value is AnyAvailable
412+
// +kubebuilder:default=AnyAvailable
413+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
414+
// +optional
415+
HostAffinity HostAffinity `json:"hostAffinity,omitempty"`
416+
417+
// host specifies a particular dedicated host when required by hostAffinity or when
418+
// hostAffinity is omitted and you want to target a specific host.
419+
// Must be omitted when hostAffinity is "AnyAvailable".
420+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
421+
// +optional
422+
Host Host `json:"host,omitzero"`
423+
}
424+
425+
// HostAffinity selects how an instance should be placed on AWS Dedicated Hosts.
426+
// +kubebuilder:validation:Enum:=Host;AnyAvailable
427+
type HostAffinity string
428+
429+
const (
430+
// HostAffinityAnyAvailable lets the platform select any available dedicated host.
431+
HostAffinityAnyAvailable HostAffinity = "AnyAvailable"
432+
433+
// HostAffinityHost requires specifying a particular host via dedicatedHost.host.hostID.
434+
HostAffinityHost HostAffinity = "Host"
435+
)
436+
437+
type Host struct {
438+
// id identifies the AWS Dedicated Host on which the instance must run.
439+
// The value must start with "h-" followed by 17 lowercase hexadecimal characters (0-9 and a-f).
440+
// Minimum length is 19 characters.
441+
// Maximum length is 19 characters.
442+
// +kubebuilder:validation:XValidation:rule="self.matches('^h-[0-9a-f]{17}$')",message="hostID must start with 'h-' followed by 17 lowercase hexadecimal characters (0-9 and a-f)"
443+
// +kubebuilder:validation:MinLength=19
444+
// +kubebuilder:validation:MaxLength=19
445+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
446+
// +required
447+
HostID string `json:"id,omitempty"`
448+
}

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 38 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: 57 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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22649,6 +22649,10 @@
2264922649
"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.",
2265022650
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
2265122651
},
22652+
"dedicatedHost": {
22653+
"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.",
22654+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.DedicatedHost"
22655+
},
2265222656
"deviceIndex": {
2265322657
"description": "deviceIndex is the index of the device on the instance for the network interface attachment. Defaults to 0.",
2265422658
"type": "integer",
@@ -23242,6 +23246,20 @@
2324223246
}
2324323247
}
2324423248
},
23249+
"com.github.openshift.api.machine.v1beta1.DedicatedHost": {
23250+
"type": "object",
23251+
"properties": {
23252+
"host": {
23253+
"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\".",
23254+
"default": {},
23255+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.Host"
23256+
},
23257+
"hostAffinity": {
23258+
"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 AnyAvailable, and you stop and restart the instance, it can be restarted on any available host. When HostAffinity is defined, Host is required. The default value is AnyAvailable",
23259+
"type": "string"
23260+
}
23261+
}
23262+
},
2324523263
"com.github.openshift.api.machine.v1beta1.DiskEncryptionSetParameters": {
2324623264
"description": "DiskEncryptionSetParameters is the disk encryption set properties",
2324723265
"type": "object",
@@ -23712,6 +23730,18 @@
2371223730
}
2371323731
}
2371423732
},
23733+
"com.github.openshift.api.machine.v1beta1.Host": {
23734+
"type": "object",
23735+
"required": [
23736+
"id"
23737+
],
23738+
"properties": {
23739+
"id": {
23740+
"description": "id identifies the AWS Dedicated Host on which the instance must run. The value must start with \"h-\" followed by 17 lowercase hexadecimal characters (0-9 and a-f). Minimum length is 19 characters. Maximum length is 19 characters.",
23741+
"type": "string"
23742+
}
23743+
}
23744+
},
2371523745
"com.github.openshift.api.machine.v1beta1.Image": {
2371623746
"description": "Image is a mirror of azure sdk compute.ImageReference",
2371723747
"type": "object",

0 commit comments

Comments
 (0)