Skip to content

Commit c503f95

Browse files
committed
Added AWS dedicated host support
1 parent fe48e8f commit c503f95

File tree

6 files changed

+201
-3
lines changed

6 files changed

+201
-3
lines changed

features/features.go

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

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

machine/v1beta1/types_awsprovider.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ 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+
// hostPlacement configures placement on AWS Dedicated Hosts.
119+
// When omitted, the instance is not constrained to a dedicated host.
120+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
121+
// +optional
122+
HostPlacement *HostPlacement `json:"hostPlacement,omitempty"`
117123
}
118124

119125
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
@@ -393,3 +399,46 @@ const (
393399
// When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
394400
MarketTypeCapacityBlock MarketType = "CapacityBlock"
395401
)
402+
403+
type HostPlacement struct {
404+
// affinity specifies the affinity setting for the instance.
405+
// When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. This setting also requires the configuration of DedicatedHost.
406+
// When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
407+
// When Affinity is set to DedicatedHost, dedicated field is required.
408+
// The default value is AnyAvailable
409+
// +kubebuilder:default=AnyAvailable
410+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
411+
// +optional
412+
Affinity *HostAffinity `json:"affinity,omitempty"`
413+
414+
// dedicated specifies a particular dedicated host when required by affinity set to DedicatedHost.
415+
// Must be omitted when hostAffinity is "AnyAvailable".
416+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
417+
// +optional
418+
Dedicated *DedicatedHost `json:"dedicated,omitempty"`
419+
}
420+
421+
// HostAffinity selects how an instance should be placed on AWS Dedicated Hosts.
422+
// +kubebuilder:validation:Enum:=DedicatedHost;AnyAvailable
423+
type HostAffinity string
424+
425+
const (
426+
// HostAffinityAnyAvailable lets the platform select any available dedicated host.
427+
HostAffinityAnyAvailable HostAffinity = "AnyAvailable"
428+
429+
// HostAffinityDedicatedHost requires specifying a particular host via dedicatedHost.host.hostID.
430+
HostAffinityDedicatedHost HostAffinity = "DedicatedHost"
431+
)
432+
433+
type DedicatedHost struct {
434+
// id identifies the AWS Dedicated Host on which the instance must run.
435+
// The value must start with "h-" followed by 17 lowercase hexadecimal characters (0-9 and a-f).
436+
// Minimum length is 19 characters.
437+
// Maximum length is 19 characters.
438+
// +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)"
439+
// +kubebuilder:validation:MinLength=19
440+
// +kubebuilder:validation:MaxLength=19
441+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
442+
// +required
443+
ID string `json:"id,omitempty"`
444+
}

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 47 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: 56 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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22655,6 +22655,10 @@
2265522655
"format": "int64",
2265622656
"default": 0
2265722657
},
22658+
"hostPlacement": {
22659+
"description": "hostPlacement configures placement on AWS Dedicated Hosts. When omitted, the instance is not constrained to a dedicated host.",
22660+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.HostPlacement"
22661+
},
2265822662
"iamInstanceProfile": {
2265922663
"description": "iamInstanceProfile is a reference to an IAM role to assign to the instance",
2266022664
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.AWSResourceReference"
@@ -23242,6 +23246,18 @@
2324223246
}
2324323247
}
2324423248
},
23249+
"com.github.openshift.api.machine.v1beta1.DedicatedHost": {
23250+
"type": "object",
23251+
"required": [
23252+
"id"
23253+
],
23254+
"properties": {
23255+
"id": {
23256+
"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.",
23257+
"type": "string"
23258+
}
23259+
}
23260+
},
2324523261
"com.github.openshift.api.machine.v1beta1.DiskEncryptionSetParameters": {
2324623262
"description": "DiskEncryptionSetParameters is the disk encryption set properties",
2324723263
"type": "object",
@@ -23712,6 +23728,19 @@
2371223728
}
2371323729
}
2371423730
},
23731+
"com.github.openshift.api.machine.v1beta1.HostPlacement": {
23732+
"type": "object",
23733+
"properties": {
23734+
"affinity": {
23735+
"description": "affinity specifies the affinity setting for the instance. When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. This setting also requires the configuration of DedicatedHost. When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host. When Affinity is set to DedicatedHost, dedicated field is required. The default value is AnyAvailable",
23736+
"type": "string"
23737+
},
23738+
"dedicated": {
23739+
"description": "dedicated specifies a particular dedicated host when required by affinity set to DedicatedHost. Must be omitted when hostAffinity is \"AnyAvailable\".",
23740+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.DedicatedHost"
23741+
}
23742+
}
23743+
},
2371523744
"com.github.openshift.api.machine.v1beta1.Image": {
2371623745
"description": "Image is a mirror of azure sdk compute.ImageReference",
2371723746
"type": "object",

0 commit comments

Comments
 (0)